{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "<table style=\"float:left; border:none\">\n",
    "   <tr style=\"border:none; background-color: #ffffff\">\n",
    "       <td style=\"border:none\">\n",
    "           <a href=\"http://bokeh.pydata.org/\">     \n",
    "           <img \n",
    "               src=\"assets/bokeh-transparent.png\" \n",
    "               style=\"width:50px\"\n",
    "           >\n",
    "           </a>    \n",
    "       </td>\n",
    "       <td style=\"border:none\">\n",
    "           <h1>Bokeh 教程</h1>\n",
    "       </td>\n",
    "   </tr>\n",
    "</table>\n",
    "\n",
    "<div style=\"float:right;\"><h2>03. 添加注释</h2></div>"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "from bokeh.io import output_notebook, show\n",
    "from bokeh.plotting import figure"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "\n",
       "    <div class=\"bk-root\">\n",
       "        <a href=\"https://bokeh.pydata.org\" target=\"_blank\" class=\"bk-logo bk-logo-small bk-logo-notebook\"></a>\n",
       "        <span id=\"dfcf0f43-586c-45a9-a9ee-5b4916474703\">Loading BokehJS ...</span>\n",
       "    </div>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "application/javascript": [
       "\n",
       "(function(root) {\n",
       "  function now() {\n",
       "    return new Date();\n",
       "  }\n",
       "\n",
       "  var force = true;\n",
       "\n",
       "  if (typeof (root._bokeh_onload_callbacks) === \"undefined\" || force === true) {\n",
       "    root._bokeh_onload_callbacks = [];\n",
       "    root._bokeh_is_loading = undefined;\n",
       "  }\n",
       "\n",
       "  var JS_MIME_TYPE = 'application/javascript';\n",
       "  var HTML_MIME_TYPE = 'text/html';\n",
       "  var EXEC_MIME_TYPE = 'application/vnd.bokehjs_exec.v0+json';\n",
       "  var CLASS_NAME = 'output_bokeh rendered_html';\n",
       "\n",
       "  /**\n",
       "   * Render data to the DOM node\n",
       "   */\n",
       "  function render(props, node) {\n",
       "    var script = document.createElement(\"script\");\n",
       "    node.appendChild(script);\n",
       "  }\n",
       "\n",
       "  /**\n",
       "   * Handle when an output is cleared or removed\n",
       "   */\n",
       "  function handleClearOutput(event, handle) {\n",
       "    var cell = handle.cell;\n",
       "\n",
       "    var id = cell.output_area._bokeh_element_id;\n",
       "    var server_id = cell.output_area._bokeh_server_id;\n",
       "    // Clean up Bokeh references\n",
       "    if (id !== undefined) {\n",
       "      Bokeh.index[id].model.document.clear();\n",
       "      delete Bokeh.index[id];\n",
       "    }\n",
       "\n",
       "    if (server_id !== undefined) {\n",
       "      // Clean up Bokeh references\n",
       "      var cmd = \"from bokeh.io.state import curstate; print(curstate().uuid_to_server['\" + server_id + \"'].get_sessions()[0].document.roots[0]._id)\";\n",
       "      cell.notebook.kernel.execute(cmd, {\n",
       "        iopub: {\n",
       "          output: function(msg) {\n",
       "            var element_id = msg.content.text.trim();\n",
       "            Bokeh.index[element_id].model.document.clear();\n",
       "            delete Bokeh.index[element_id];\n",
       "          }\n",
       "        }\n",
       "      });\n",
       "      // Destroy server and session\n",
       "      var cmd = \"import bokeh.io.notebook as ion; ion.destroy_server('\" + server_id + \"')\";\n",
       "      cell.notebook.kernel.execute(cmd);\n",
       "    }\n",
       "  }\n",
       "\n",
       "  /**\n",
       "   * Handle when a new output is added\n",
       "   */\n",
       "  function handleAddOutput(event, handle) {\n",
       "    var output_area = handle.output_area;\n",
       "    var output = handle.output;\n",
       "\n",
       "    // limit handleAddOutput to display_data with EXEC_MIME_TYPE content only\n",
       "    if ((output.output_type != \"display_data\") || (!output.data.hasOwnProperty(EXEC_MIME_TYPE))) {\n",
       "      return\n",
       "    }\n",
       "\n",
       "    var toinsert = output_area.element.find(`.${CLASS_NAME.split(' ')[0]}`);\n",
       "\n",
       "    if (output.metadata[EXEC_MIME_TYPE][\"id\"] !== undefined) {\n",
       "      toinsert[0].firstChild.textContent = output.data[JS_MIME_TYPE];\n",
       "      // store reference to embed id on output_area\n",
       "      output_area._bokeh_element_id = output.metadata[EXEC_MIME_TYPE][\"id\"];\n",
       "    }\n",
       "    if (output.metadata[EXEC_MIME_TYPE][\"server_id\"] !== undefined) {\n",
       "      var bk_div = document.createElement(\"div\");\n",
       "      bk_div.innerHTML = output.data[HTML_MIME_TYPE];\n",
       "      var script_attrs = bk_div.children[0].attributes;\n",
       "      for (var i = 0; i < script_attrs.length; i++) {\n",
       "        toinsert[0].firstChild.setAttribute(script_attrs[i].name, script_attrs[i].value);\n",
       "      }\n",
       "      // store reference to server id on output_area\n",
       "      output_area._bokeh_server_id = output.metadata[EXEC_MIME_TYPE][\"server_id\"];\n",
       "    }\n",
       "  }\n",
       "\n",
       "  function register_renderer(events, OutputArea) {\n",
       "\n",
       "    function append_mime(data, metadata, element) {\n",
       "      // create a DOM node to render to\n",
       "      var toinsert = this.create_output_subarea(\n",
       "        metadata,\n",
       "        CLASS_NAME,\n",
       "        EXEC_MIME_TYPE\n",
       "      );\n",
       "      this.keyboard_manager.register_events(toinsert);\n",
       "      // Render to node\n",
       "      var props = {data: data, metadata: metadata[EXEC_MIME_TYPE]};\n",
       "      render(props, toinsert[0]);\n",
       "      element.append(toinsert);\n",
       "      return toinsert\n",
       "    }\n",
       "\n",
       "    /* Handle when an output is cleared or removed */\n",
       "    events.on('clear_output.CodeCell', handleClearOutput);\n",
       "    events.on('delete.Cell', handleClearOutput);\n",
       "\n",
       "    /* Handle when a new output is added */\n",
       "    events.on('output_added.OutputArea', handleAddOutput);\n",
       "\n",
       "    /**\n",
       "     * Register the mime type and append_mime function with output_area\n",
       "     */\n",
       "    OutputArea.prototype.register_mime_type(EXEC_MIME_TYPE, append_mime, {\n",
       "      /* Is output safe? */\n",
       "      safe: true,\n",
       "      /* Index of renderer in `output_area.display_order` */\n",
       "      index: 0\n",
       "    });\n",
       "  }\n",
       "\n",
       "  // register the mime type if in Jupyter Notebook environment and previously unregistered\n",
       "  if (root.Jupyter !== undefined) {\n",
       "    var events = require('base/js/events');\n",
       "    var OutputArea = require('notebook/js/outputarea').OutputArea;\n",
       "\n",
       "    if (OutputArea.prototype.mime_types().indexOf(EXEC_MIME_TYPE) == -1) {\n",
       "      register_renderer(events, OutputArea);\n",
       "    }\n",
       "  }\n",
       "\n",
       "  \n",
       "  if (typeof (root._bokeh_timeout) === \"undefined\" || force === true) {\n",
       "    root._bokeh_timeout = Date.now() + 5000;\n",
       "    root._bokeh_failed_load = false;\n",
       "  }\n",
       "\n",
       "  var NB_LOAD_WARNING = {'data': {'text/html':\n",
       "     \"<div style='background-color: #fdd'>\\n\"+\n",
       "     \"<p>\\n\"+\n",
       "     \"BokehJS does not appear to have successfully loaded. If loading BokehJS from CDN, this \\n\"+\n",
       "     \"may be due to a slow or bad network connection. Possible fixes:\\n\"+\n",
       "     \"</p>\\n\"+\n",
       "     \"<ul>\\n\"+\n",
       "     \"<li>re-rerun `output_notebook()` to attempt to load from CDN again, or</li>\\n\"+\n",
       "     \"<li>use INLINE resources instead, as so:</li>\\n\"+\n",
       "     \"</ul>\\n\"+\n",
       "     \"<code>\\n\"+\n",
       "     \"from bokeh.resources import INLINE\\n\"+\n",
       "     \"output_notebook(resources=INLINE)\\n\"+\n",
       "     \"</code>\\n\"+\n",
       "     \"</div>\"}};\n",
       "\n",
       "  function display_loaded() {\n",
       "    var el = document.getElementById(\"dfcf0f43-586c-45a9-a9ee-5b4916474703\");\n",
       "    if (el != null) {\n",
       "      el.textContent = \"BokehJS is loading...\";\n",
       "    }\n",
       "    if (root.Bokeh !== undefined) {\n",
       "      if (el != null) {\n",
       "        el.textContent = \"BokehJS \" + root.Bokeh.version + \" successfully loaded.\";\n",
       "      }\n",
       "    } else if (Date.now() < root._bokeh_timeout) {\n",
       "      setTimeout(display_loaded, 100)\n",
       "    }\n",
       "  }\n",
       "\n",
       "\n",
       "  function run_callbacks() {\n",
       "    try {\n",
       "      root._bokeh_onload_callbacks.forEach(function(callback) { callback() });\n",
       "    }\n",
       "    finally {\n",
       "      delete root._bokeh_onload_callbacks\n",
       "    }\n",
       "    console.info(\"Bokeh: all callbacks have finished\");\n",
       "  }\n",
       "\n",
       "  function load_libs(js_urls, callback) {\n",
       "    root._bokeh_onload_callbacks.push(callback);\n",
       "    if (root._bokeh_is_loading > 0) {\n",
       "      console.log(\"Bokeh: BokehJS is being loaded, scheduling callback at\", now());\n",
       "      return null;\n",
       "    }\n",
       "    if (js_urls == null || js_urls.length === 0) {\n",
       "      run_callbacks();\n",
       "      return null;\n",
       "    }\n",
       "    console.log(\"Bokeh: BokehJS not loaded, scheduling load and callback at\", now());\n",
       "    root._bokeh_is_loading = js_urls.length;\n",
       "    for (var i = 0; i < js_urls.length; i++) {\n",
       "      var url = js_urls[i];\n",
       "      var s = document.createElement('script');\n",
       "      s.src = url;\n",
       "      s.async = false;\n",
       "      s.onreadystatechange = s.onload = function() {\n",
       "        root._bokeh_is_loading--;\n",
       "        if (root._bokeh_is_loading === 0) {\n",
       "          console.log(\"Bokeh: all BokehJS libraries loaded\");\n",
       "          run_callbacks()\n",
       "        }\n",
       "      };\n",
       "      s.onerror = function() {\n",
       "        console.warn(\"failed to load library \" + url);\n",
       "      };\n",
       "      console.log(\"Bokeh: injecting script tag for BokehJS library: \", url);\n",
       "      document.getElementsByTagName(\"head\")[0].appendChild(s);\n",
       "    }\n",
       "  };var element = document.getElementById(\"dfcf0f43-586c-45a9-a9ee-5b4916474703\");\n",
       "  if (element == null) {\n",
       "    console.log(\"Bokeh: ERROR: autoload.js configured with elementid 'dfcf0f43-586c-45a9-a9ee-5b4916474703' but no matching script tag was found. \")\n",
       "    return false;\n",
       "  }\n",
       "\n",
       "  var js_urls = [\"https://cdn.pydata.org/bokeh/release/bokeh-0.12.10.min.js\", \"https://cdn.pydata.org/bokeh/release/bokeh-widgets-0.12.10.min.js\", \"https://cdn.pydata.org/bokeh/release/bokeh-tables-0.12.10.min.js\", \"https://cdn.pydata.org/bokeh/release/bokeh-gl-0.12.10.min.js\"];\n",
       "\n",
       "  var inline_js = [\n",
       "    function(Bokeh) {\n",
       "      Bokeh.set_log_level(\"info\");\n",
       "    },\n",
       "    \n",
       "    function(Bokeh) {\n",
       "      \n",
       "    },\n",
       "    function(Bokeh) {\n",
       "      console.log(\"Bokeh: injecting CSS: https://cdn.pydata.org/bokeh/release/bokeh-0.12.10.min.css\");\n",
       "      Bokeh.embed.inject_css(\"https://cdn.pydata.org/bokeh/release/bokeh-0.12.10.min.css\");\n",
       "      console.log(\"Bokeh: injecting CSS: https://cdn.pydata.org/bokeh/release/bokeh-widgets-0.12.10.min.css\");\n",
       "      Bokeh.embed.inject_css(\"https://cdn.pydata.org/bokeh/release/bokeh-widgets-0.12.10.min.css\");\n",
       "      console.log(\"Bokeh: injecting CSS: https://cdn.pydata.org/bokeh/release/bokeh-tables-0.12.10.min.css\");\n",
       "      Bokeh.embed.inject_css(\"https://cdn.pydata.org/bokeh/release/bokeh-tables-0.12.10.min.css\");\n",
       "    }\n",
       "  ];\n",
       "\n",
       "  function run_inline_js() {\n",
       "    \n",
       "    if ((root.Bokeh !== undefined) || (force === true)) {\n",
       "      for (var i = 0; i < inline_js.length; i++) {\n",
       "        inline_js[i].call(root, root.Bokeh);\n",
       "      }if (force === true) {\n",
       "        display_loaded();\n",
       "      }} else if (Date.now() < root._bokeh_timeout) {\n",
       "      setTimeout(run_inline_js, 100);\n",
       "    } else if (!root._bokeh_failed_load) {\n",
       "      console.log(\"Bokeh: BokehJS failed to load within specified timeout.\");\n",
       "      root._bokeh_failed_load = true;\n",
       "    } else if (force !== true) {\n",
       "      var cell = $(document.getElementById(\"dfcf0f43-586c-45a9-a9ee-5b4916474703\")).parents('.cell').data().cell;\n",
       "      cell.output_area.append_execute_result(NB_LOAD_WARNING)\n",
       "    }\n",
       "\n",
       "  }\n",
       "\n",
       "  if (root._bokeh_is_loading === 0) {\n",
       "    console.log(\"Bokeh: BokehJS loaded, going straight to plotting\");\n",
       "    run_inline_js();\n",
       "  } else {\n",
       "    load_libs(js_urls, function() {\n",
       "      console.log(\"Bokeh: BokehJS plotting callback run at\", now());\n",
       "      run_inline_js();\n",
       "    });\n",
       "  }\n",
       "}(window));"
      ],
      "application/vnd.bokehjs_load.v0+json": "\n(function(root) {\n  function now() {\n    return new Date();\n  }\n\n  var force = true;\n\n  if (typeof (root._bokeh_onload_callbacks) === \"undefined\" || force === true) {\n    root._bokeh_onload_callbacks = [];\n    root._bokeh_is_loading = undefined;\n  }\n\n  \n\n  \n  if (typeof (root._bokeh_timeout) === \"undefined\" || force === true) {\n    root._bokeh_timeout = Date.now() + 5000;\n    root._bokeh_failed_load = false;\n  }\n\n  var NB_LOAD_WARNING = {'data': {'text/html':\n     \"<div style='background-color: #fdd'>\\n\"+\n     \"<p>\\n\"+\n     \"BokehJS does not appear to have successfully loaded. If loading BokehJS from CDN, this \\n\"+\n     \"may be due to a slow or bad network connection. Possible fixes:\\n\"+\n     \"</p>\\n\"+\n     \"<ul>\\n\"+\n     \"<li>re-rerun `output_notebook()` to attempt to load from CDN again, or</li>\\n\"+\n     \"<li>use INLINE resources instead, as so:</li>\\n\"+\n     \"</ul>\\n\"+\n     \"<code>\\n\"+\n     \"from bokeh.resources import INLINE\\n\"+\n     \"output_notebook(resources=INLINE)\\n\"+\n     \"</code>\\n\"+\n     \"</div>\"}};\n\n  function display_loaded() {\n    var el = document.getElementById(\"dfcf0f43-586c-45a9-a9ee-5b4916474703\");\n    if (el != null) {\n      el.textContent = \"BokehJS is loading...\";\n    }\n    if (root.Bokeh !== undefined) {\n      if (el != null) {\n        el.textContent = \"BokehJS \" + root.Bokeh.version + \" successfully loaded.\";\n      }\n    } else if (Date.now() < root._bokeh_timeout) {\n      setTimeout(display_loaded, 100)\n    }\n  }\n\n\n  function run_callbacks() {\n    try {\n      root._bokeh_onload_callbacks.forEach(function(callback) { callback() });\n    }\n    finally {\n      delete root._bokeh_onload_callbacks\n    }\n    console.info(\"Bokeh: all callbacks have finished\");\n  }\n\n  function load_libs(js_urls, callback) {\n    root._bokeh_onload_callbacks.push(callback);\n    if (root._bokeh_is_loading > 0) {\n      console.log(\"Bokeh: BokehJS is being loaded, scheduling callback at\", now());\n      return null;\n    }\n    if (js_urls == null || js_urls.length === 0) {\n      run_callbacks();\n      return null;\n    }\n    console.log(\"Bokeh: BokehJS not loaded, scheduling load and callback at\", now());\n    root._bokeh_is_loading = js_urls.length;\n    for (var i = 0; i < js_urls.length; i++) {\n      var url = js_urls[i];\n      var s = document.createElement('script');\n      s.src = url;\n      s.async = false;\n      s.onreadystatechange = s.onload = function() {\n        root._bokeh_is_loading--;\n        if (root._bokeh_is_loading === 0) {\n          console.log(\"Bokeh: all BokehJS libraries loaded\");\n          run_callbacks()\n        }\n      };\n      s.onerror = function() {\n        console.warn(\"failed to load library \" + url);\n      };\n      console.log(\"Bokeh: injecting script tag for BokehJS library: \", url);\n      document.getElementsByTagName(\"head\")[0].appendChild(s);\n    }\n  };var element = document.getElementById(\"dfcf0f43-586c-45a9-a9ee-5b4916474703\");\n  if (element == null) {\n    console.log(\"Bokeh: ERROR: autoload.js configured with elementid 'dfcf0f43-586c-45a9-a9ee-5b4916474703' but no matching script tag was found. \")\n    return false;\n  }\n\n  var js_urls = [\"https://cdn.pydata.org/bokeh/release/bokeh-0.12.10.min.js\", \"https://cdn.pydata.org/bokeh/release/bokeh-widgets-0.12.10.min.js\", \"https://cdn.pydata.org/bokeh/release/bokeh-tables-0.12.10.min.js\", \"https://cdn.pydata.org/bokeh/release/bokeh-gl-0.12.10.min.js\"];\n\n  var inline_js = [\n    function(Bokeh) {\n      Bokeh.set_log_level(\"info\");\n    },\n    \n    function(Bokeh) {\n      \n    },\n    function(Bokeh) {\n      console.log(\"Bokeh: injecting CSS: https://cdn.pydata.org/bokeh/release/bokeh-0.12.10.min.css\");\n      Bokeh.embed.inject_css(\"https://cdn.pydata.org/bokeh/release/bokeh-0.12.10.min.css\");\n      console.log(\"Bokeh: injecting CSS: https://cdn.pydata.org/bokeh/release/bokeh-widgets-0.12.10.min.css\");\n      Bokeh.embed.inject_css(\"https://cdn.pydata.org/bokeh/release/bokeh-widgets-0.12.10.min.css\");\n      console.log(\"Bokeh: injecting CSS: https://cdn.pydata.org/bokeh/release/bokeh-tables-0.12.10.min.css\");\n      Bokeh.embed.inject_css(\"https://cdn.pydata.org/bokeh/release/bokeh-tables-0.12.10.min.css\");\n    }\n  ];\n\n  function run_inline_js() {\n    \n    if ((root.Bokeh !== undefined) || (force === true)) {\n      for (var i = 0; i < inline_js.length; i++) {\n        inline_js[i].call(root, root.Bokeh);\n      }if (force === true) {\n        display_loaded();\n      }} else if (Date.now() < root._bokeh_timeout) {\n      setTimeout(run_inline_js, 100);\n    } else if (!root._bokeh_failed_load) {\n      console.log(\"Bokeh: BokehJS failed to load within specified timeout.\");\n      root._bokeh_failed_load = true;\n    } else if (force !== true) {\n      var cell = $(document.getElementById(\"dfcf0f43-586c-45a9-a9ee-5b4916474703\")).parents('.cell').data().cell;\n      cell.output_area.append_execute_result(NB_LOAD_WARNING)\n    }\n\n  }\n\n  if (root._bokeh_is_loading === 0) {\n    console.log(\"Bokeh: BokehJS loaded, going straight to plotting\");\n    run_inline_js();\n  } else {\n    load_libs(js_urls, function() {\n      console.log(\"Bokeh: BokehJS plotting callback run at\", now());\n      run_inline_js();\n    });\n  }\n}(window));"
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "output_notebook()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# 概要\n",
    "\n",
    "有时，我们想给图表添加一些视觉提示（边界线，阴影区域，标签和箭头等），以增强某些效果。Bokeh有几个类似的注释类型。通常，要添加注释，我们直接创建“low level”注释对象，并使用`add_layout`添加到我们的`Plot`、`Figure` 或 `Chart`中。让我们看看一些具体的例子。"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "collapsed": true
   },
   "source": [
    "## Spans\n",
    "\n",
    "`Spans`是“无限”的垂直线或水平线。在创建它们时，指定要跨越的`dimension`（即`width`或`height`）、线的外观视觉属性以及绘制该直线所需的位置。让我们来看一个示例，将两个水平span添加到一个简单的图中： "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "\n",
       "<div class=\"bk-root\">\n",
       "    <div class=\"bk-plotdiv\" id=\"46898a88-cd14-4307-8c13-f2de52fda956\"></div>\n",
       "</div>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "application/javascript": [
       "(function(root) {\n",
       "  function embed_document(root) {\n",
       "    var docs_json = {\"a277b98c-1c10-4bb3-bc3a-c7fa48d142c4\":{\"roots\":{\"references\":[{\"attributes\":{},\"id\":\"ea927f9c-1d15-4708-a162-3fb3895a20f8\",\"type\":\"HelpTool\"},{\"attributes\":{},\"id\":\"de1c8c70-020c-42ec-a758-6c7f2815171f\",\"type\":\"LinearScale\"},{\"attributes\":{\"line_alpha\":{\"value\":0.1},\"line_color\":{\"value\":\"#1f77b4\"},\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"39cca02f-fd60-47db-b742-dfc3181b1d05\",\"type\":\"Line\"},{\"attributes\":{\"formatter\":{\"id\":\"9ded3e13-f2e6-4e3a-8534-8b2f58625965\",\"type\":\"BasicTickFormatter\"},\"plot\":{\"id\":\"7b57bc31-4d40-42e4-a062-8ea4751332cf\",\"subtype\":\"Figure\",\"type\":\"Plot\"},\"ticker\":{\"id\":\"392dafe9-8556-486f-ae01-9c4cce23116a\",\"type\":\"BasicTicker\"}},\"id\":\"11745dfd-9768-41fc-8e48-b0c20debc685\",\"type\":\"LinearAxis\"},{\"attributes\":{},\"id\":\"392dafe9-8556-486f-ae01-9c4cce23116a\",\"type\":\"BasicTicker\"},{\"attributes\":{\"plot\":{\"id\":\"7b57bc31-4d40-42e4-a062-8ea4751332cf\",\"subtype\":\"Figure\",\"type\":\"Plot\"},\"ticker\":{\"id\":\"392dafe9-8556-486f-ae01-9c4cce23116a\",\"type\":\"BasicTicker\"}},\"id\":\"2c48d0b1-166f-4b8f-aed9-1d291b9d81da\",\"type\":\"Grid\"},{\"attributes\":{\"line_color\":{\"value\":\"#1f77b4\"},\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"8915b538-78fb-4650-b718-17ada7a6226c\",\"type\":\"Line\"},{\"attributes\":{\"formatter\":{\"id\":\"1c565025-03b5-4e7c-9e0f-38cde1b9763a\",\"type\":\"BasicTickFormatter\"},\"plot\":{\"id\":\"7b57bc31-4d40-42e4-a062-8ea4751332cf\",\"subtype\":\"Figure\",\"type\":\"Plot\"},\"ticker\":{\"id\":\"3e36ca2b-94c6-4455-b642-4e57a5b4a0a7\",\"type\":\"BasicTicker\"}},\"id\":\"e9190e31-3704-4fd6-be93-a8629ef232e1\",\"type\":\"LinearAxis\"},{\"attributes\":{},\"id\":\"1c565025-03b5-4e7c-9e0f-38cde1b9763a\",\"type\":\"BasicTickFormatter\"},{\"attributes\":{},\"id\":\"3e36ca2b-94c6-4455-b642-4e57a5b4a0a7\",\"type\":\"BasicTicker\"},{\"attributes\":{\"line_color\":{\"value\":\"firebrick\"},\"line_width\":{\"value\":4},\"location\":-1,\"plot\":{\"id\":\"7b57bc31-4d40-42e4-a062-8ea4751332cf\",\"subtype\":\"Figure\",\"type\":\"Plot\"}},\"id\":\"f1c40d1a-432f-4f6b-bf57-84227f65c385\",\"type\":\"Span\"},{\"attributes\":{\"dimension\":1,\"plot\":{\"id\":\"7b57bc31-4d40-42e4-a062-8ea4751332cf\",\"subtype\":\"Figure\",\"type\":\"Plot\"},\"ticker\":{\"id\":\"3e36ca2b-94c6-4455-b642-4e57a5b4a0a7\",\"type\":\"BasicTicker\"}},\"id\":\"43195e95-fee1-42f9-b55a-3995d8ae7f11\",\"type\":\"Grid\"},{\"attributes\":{\"bottom_units\":\"screen\",\"fill_alpha\":{\"value\":0.5},\"fill_color\":{\"value\":\"lightgrey\"},\"left_units\":\"screen\",\"level\":\"overlay\",\"line_alpha\":{\"value\":1.0},\"line_color\":{\"value\":\"black\"},\"line_dash\":[4,4],\"line_width\":{\"value\":2},\"plot\":null,\"render_mode\":\"css\",\"right_units\":\"screen\",\"top_units\":\"screen\"},\"id\":\"381cd811-9a41-4e17-8e93-d9a0220ad9a4\",\"type\":\"BoxAnnotation\"},{\"attributes\":{\"line_color\":{\"value\":\"olive\"},\"line_width\":{\"value\":4},\"location\":1,\"plot\":{\"id\":\"7b57bc31-4d40-42e4-a062-8ea4751332cf\",\"subtype\":\"Figure\",\"type\":\"Plot\"}},\"id\":\"698c28b7-e451-418c-9edc-0268ddcaac5f\",\"type\":\"Span\"},{\"attributes\":{\"callback\":null,\"column_names\":[\"x\",\"y\"],\"data\":{\"x\":{\"__ndarray__\":\"AAAAAAAAAACBhJ9ciLq5P4GEn1yIusk/YaN3ReZL0z+BhJ9ciLrZP9Gy4zmVFOA/YaN3ReZL4z/xkwtRN4PmP4GEn1yIuuk/EXUzaNnx7D/RsuM5lRTwPxmrrb89sPE/YaN3ReZL8z+pm0HLjuf0P/GTC1E3g/Y/OYzV1t8e+D+BhJ9ciLr5P8l8aeIwVvs/EXUzaNnx/D9Zbf3tgY3+P9Gy4zmVFABA9a7IfGniAEAZq62/PbABQD2nkgISfgJAYaN3ReZLA0CFn1yIuhkEQKmbQcuO5wRAzZcmDmO1BUDxkwtRN4MGQBWQ8JMLUQdAOYzV1t8eCEBdiLoZtOwIQIGEn1yIuglApYCEn1yICkDJfGniMFYLQO14TiUFJAxAEXUzaNnxDEA1cRirrb8NQFlt/e2BjQ5AfWniMFZbD0DRsuM5lRQQQOMwVlt/exBA9a7IfGniEEAHLTueU0kRQBmrrb89sBFAKykg4ScXEkA9p5ICEn4SQE8lBST85BJAYaN3ReZLE0BzIepm0LITQIWfXIi6GRRAlx3PqaSAFECpm0HLjucUQLsZtOx4ThVAzZcmDmO1FUDfFZkvTRwWQPGTC1E3gxZAAxJ+ciHqFkAVkPCTC1EXQCcOY7X1txdAOYzV1t8eGEBLC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UnXv8xCZV8FJ92/jrzgAGRc4b+9mha3avjjvxDluuXYYOa/z/f97XWP6L+iqpKRnn7qv/I9eINTKey/gKwzUUaL7b/H7xyD5KDuv/5MAddgZ++/kIRCfbrc779mI79Fwv/vvxvnJK8d0O+/7mfF0EdO778p55AckHvuv1XmbPwWWu2/M6elU8js67+VlKzyUzfqv3bLoxAkPui/gctS41EG5r8KmPxymJXjv4+oH8xF8uC/BXTAalVG3L9lymUnEl/Wv0AEjFQCPtC/k7Ftmvflw79e36K7BnKsv2DD4OpO/aY/hruvy0+Mwj+mLHIKYCnPP22ZZ+b2utU/64wZNRmp2z841R9V4qfgP5q819AvUOM/yPhiaZfG5T//wUZlvAToP1hY32XTBOo/cb3VX7HB6z/gPF312DbtPw==\",\"dtype\":\"float64\",\"shape\":[200]}}},\"id\":\"532a2c65-2333-494f-9511-2aadb446cfa1\",\"type\":\"ColumnDataSource\"},{\"attributes\":{},\"id\":\"9ded3e13-f2e6-4e3a-8534-8b2f58625965\",\"type\":\"BasicTickFormatter\"},{\"attributes\":{},\"id\":\"b3f59812-9e7a-4be9-bb17-02d15ff4d662\",\"type\":\"PanTool\"},{\"attributes\":{\"below\":[{\"id\":\"11745dfd-9768-41fc-8e48-b0c20debc685\",\"type\":\"LinearAxis\"}],\"left\":[{\"id\":\"e9190e31-3704-4fd6-be93-a8629ef232e1\",\"type\":\"LinearAxis\"}],\"renderers\":[{\"id\":\"11745dfd-9768-41fc-8e48-b0c20debc685\",\"type\":\"LinearAxis\"},{\"id\":\"2c48d0b1-166f-4b8f-aed9-1d291b9d81da\",\"type\":\"Grid\"},{\"id\":\"e9190e31-3704-4fd6-be93-a8629ef232e1\",\"type\":\"LinearAxis\"},{\"id\":\"43195e95-fee1-42f9-b55a-3995d8ae7f11\",\"type\":\"Grid\"},{\"id\":\"381cd811-9a41-4e17-8e93-d9a0220ad9a4\",\"type\":\"BoxAnnotation\"},{\"id\":\"b64b424c-eee3-4fb7-90d4-954678e65183\",\"type\":\"GlyphRenderer\"},{\"id\":\"698c28b7-e451-418c-9edc-0268ddcaac5f\",\"type\":\"Span\"},{\"id\":\"f1c40d1a-432f-4f6b-bf57-84227f65c385\",\"type\":\"Span\"}],\"title\":{\"id\":\"be1c0415-f18b-4ba1-927e-e4eb36bbc553\",\"type\":\"Title\"},\"toolbar\":{\"id\":\"30be1b53-244e-4889-829a-452fdd05a8d7\",\"type\":\"Toolbar\"},\"x_range\":{\"id\":\"5bff519b-1372-461a-8615-28f737b38940\",\"type\":\"DataRange1d\"},\"x_scale\":{\"id\":\"4f9905f1-534e-4943-b99e-e1086cde5dad\",\"type\":\"LinearScale\"},\"y_range\":{\"id\":\"27d71229-70af-4ed1-9438-16f67a6842d7\",\"type\":\"Range1d\"},\"y_scale\":{\"id\":\"de1c8c70-020c-42ec-a758-6c7f2815171f\",\"type\":\"LinearScale\"}},\"id\":\"7b57bc31-4d40-42e4-a062-8ea4751332cf\",\"subtype\":\"Figure\",\"type\":\"Plot\"},{\"attributes\":{\"active_drag\":\"auto\",\"active_inspect\":\"auto\",\"active_scroll\":\"auto\",\"active_tap\":\"auto\",\"tools\":[{\"id\":\"b3f59812-9e7a-4be9-bb17-02d15ff4d662\",\"type\":\"PanTool\"},{\"id\":\"4389bcf7-56bb-46c8-8cb3-8e00fb017fb9\",\"type\":\"WheelZoomTool\"},{\"id\":\"618dd4fd-4dba-453b-8f74-3e4f7eb7a7e1\",\"type\":\"BoxZoomTool\"},{\"id\":\"459ddc5e-1457-48b8-acbd-dc2170b4f3fc\",\"type\":\"SaveTool\"},{\"id\":\"c38867d9-b2c8-4525-8d39-1cad0f6ae91b\",\"type\":\"ResetTool\"},{\"id\":\"ea927f9c-1d15-4708-a162-3fb3895a20f8\",\"type\":\"HelpTool\"}]},\"id\":\"30be1b53-244e-4889-829a-452fdd05a8d7\",\"type\":\"Toolbar\"},{\"attributes\":{},\"id\":\"4389bcf7-56bb-46c8-8cb3-8e00fb017fb9\",\"type\":\"WheelZoomTool\"},{\"attributes\":{\"callback\":null},\"id\":\"5bff519b-1372-461a-8615-28f737b38940\",\"type\":\"DataRange1d\"},{\"attributes\":{\"source\":{\"id\":\"532a2c65-2333-494f-9511-2aadb446cfa1\",\"type\":\"ColumnDataSource\"}},\"id\":\"e334dc9e-6444-41bc-bf0f-b02e620b57f4\",\"type\":\"CDSView\"},{\"attributes\":{\"plot\":null,\"text\":\"\"},\"id\":\"be1c0415-f18b-4ba1-927e-e4eb36bbc553\",\"type\":\"Title\"},{\"attributes\":{\"overlay\":{\"id\":\"381cd811-9a41-4e17-8e93-d9a0220ad9a4\",\"type\":\"BoxAnnotation\"}},\"id\":\"618dd4fd-4dba-453b-8f74-3e4f7eb7a7e1\",\"type\":\"BoxZoomTool\"},{\"attributes\":{\"data_source\":{\"id\":\"532a2c65-2333-494f-9511-2aadb446cfa1\",\"type\":\"ColumnDataSource\"},\"glyph\":{\"id\":\"8915b538-78fb-4650-b718-17ada7a6226c\",\"type\":\"Line\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"39cca02f-fd60-47db-b742-dfc3181b1d05\",\"type\":\"Line\"},\"selection_glyph\":null,\"view\":{\"id\":\"e334dc9e-6444-41bc-bf0f-b02e620b57f4\",\"type\":\"CDSView\"}},\"id\":\"b64b424c-eee3-4fb7-90d4-954678e65183\",\"type\":\"GlyphRenderer\"},{\"attributes\":{},\"id\":\"459ddc5e-1457-48b8-acbd-dc2170b4f3fc\",\"type\":\"SaveTool\"},{\"attributes\":{\"callback\":null,\"end\":2,\"start\":-2},\"id\":\"27d71229-70af-4ed1-9438-16f67a6842d7\",\"type\":\"Range1d\"},{\"attributes\":{},\"id\":\"c38867d9-b2c8-4525-8d39-1cad0f6ae91b\",\"type\":\"ResetTool\"},{\"attributes\":{},\"id\":\"4f9905f1-534e-4943-b99e-e1086cde5dad\",\"type\":\"LinearScale\"}],\"root_ids\":[\"7b57bc31-4d40-42e4-a062-8ea4751332cf\"]},\"title\":\"Bokeh Application\",\"version\":\"0.12.10\"}};\n",
       "    var render_items = [{\"docid\":\"a277b98c-1c10-4bb3-bc3a-c7fa48d142c4\",\"elementid\":\"46898a88-cd14-4307-8c13-f2de52fda956\",\"modelid\":\"7b57bc31-4d40-42e4-a062-8ea4751332cf\"}];\n",
       "\n",
       "    root.Bokeh.embed.embed_items(docs_json, render_items);\n",
       "  }\n",
       "\n",
       "  if (root.Bokeh !== undefined) {\n",
       "    embed_document(root);\n",
       "  } else {\n",
       "    var attempts = 0;\n",
       "    var timer = setInterval(function(root) {\n",
       "      if (root.Bokeh !== undefined) {\n",
       "        embed_document(root);\n",
       "        clearInterval(timer);\n",
       "      }\n",
       "      attempts++;\n",
       "      if (attempts > 100) {\n",
       "        console.log(\"Bokeh: ERROR: Unable to embed document because BokehJS library is missing\")\n",
       "        clearInterval(timer);\n",
       "      }\n",
       "    }, 10, root)\n",
       "  }\n",
       "})(window);"
      ],
      "application/vnd.bokehjs_exec.v0+json": ""
     },
     "metadata": {
      "application/vnd.bokehjs_exec.v0+json": {
       "id": "7b57bc31-4d40-42e4-a062-8ea4751332cf"
      }
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "import numpy as np\n",
    "from bokeh.models.annotations import Span\n",
    "\n",
    "x = np.linspace(0, 20, 200)\n",
    "y = np.sin(x)\n",
    "\n",
    "p = figure(y_range=(-2, 2))\n",
    "p.line(x, y)\n",
    "\n",
    "upper = Span(location=1, dimension='width', line_color='olive', line_width=4)\n",
    "p.add_layout(upper)\n",
    "\n",
    "lower = Span(location=-1, dimension='width', line_color='firebrick', line_width=4)\n",
    "p.add_layout(lower)\n",
    "\n",
    "show(p)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "# Exercise:\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "collapsed": true
   },
   "source": [
    "## Box Annotations（Box注释）\n",
    "\n",
    "有时您可能需要通过绘制一个阴影框来突出图中的某些区域。`BoxAnnotation`可以做到，其通过如下属性以及任一line和fill视觉属性来控制外观：\n",
    "* `top`\n",
    "* `left`\n",
    "* `bottom`\n",
    "* `right`\n",
    "\n",
    "如果某个维度坐标空着不指定，就可以得到“无限”Box。例如，不指定`top`，Box将一直延伸到绘图区域的顶部，无论发生任何平移或缩放。\n",
    "\n",
    "让我们来看一个示例，在图中添加一些阴影框："
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {
    "scrolled": false
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "\n",
       "<div class=\"bk-root\">\n",
       "    <div class=\"bk-plotdiv\" id=\"57e3b03e-11e9-46a9-b16a-0ad52d89b780\"></div>\n",
       "</div>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "application/javascript": [
       "(function(root) {\n",
       "  function embed_document(root) {\n",
       "    var docs_json = {\"b640d3c2-dfc9-44a9-aa00-1a43664c42e0\":{\"roots\":{\"references\":[{\"attributes\":{},\"id\":\"ad7880d9-b9a4-453c-b1f4-5e012b329dae\",\"type\":\"HelpTool\"},{\"attributes\":{\"plot\":null,\"text\":\"\"},\"id\":\"ce9e1a68-15a3-4750-aaf7-d999ead910c9\",\"type\":\"Title\"},{\"attributes\":{\"line_color\":{\"value\":\"#1f77b4\"},\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"61b4d567-203b-43a5-b298-f73c03a45d13\",\"type\":\"Line\"},{\"attributes\":{\"source\":{\"id\":\"019062fe-83a9-40df-970a-37fc4b732e2b\",\"type\":\"ColumnDataSource\"}},\"id\":\"64081066-d333-45e5-8566-febbca2546a3\",\"type\":\"CDSView\"},{\"attributes\":{\"callback\":null},\"id\":\"d8bb454b-953f-4558-aeb4-fff75aed2c58\",\"type\":\"DataRange1d\"},{\"attributes\":{\"plot\":{\"id\":\"9b5b4f48-6165-40e4-94cd-678c208eca72\",\"subtype\":\"Figure\",\"type\":\"Plot\"},\"ticker\":{\"id\":\"30c720f8-3eb3-4a6c-93a6-d1150aff8121\",\"type\":\"BasicTicker\"}},\"id\":\"9ddcdc85-a3b4-4772-9f69-cadca988f8dd\",\"type\":\"Grid\"},{\"attributes\":{\"fill_alpha\":{\"value\":0.1},\"fill_color\":{\"value\":\"firebrick\"},\"plot\":{\"id\":\"9b5b4f48-6165-40e4-94cd-678c208eca72\",\"subtype\":\"Figure\",\"type\":\"Plot\"},\"top\":-1},\"id\":\"c093c659-f7da-4edf-9802-e8a2e6a88754\",\"type\":\"BoxAnnotation\"},{\"attributes\":{\"formatter\":{\"id\":\"40386f16-14cb-4b4a-8647-de6dfeb84c8c\",\"type\":\"BasicTickFormatter\"},\"plot\":{\"id\":\"9b5b4f48-6165-40e4-94cd-678c208eca72\",\"subtype\":\"Figure\",\"type\":\"Plot\"},\"ticker\":{\"id\":\"30c720f8-3eb3-4a6c-93a6-d1150aff8121\",\"type\":\"BasicTicker\"}},\"id\":\"c63b9f19-1906-467e-afce-ec81a5176ca9\",\"type\":\"LinearAxis\"},{\"attributes\":{\"bottom\":1,\"fill_alpha\":{\"value\":0.1},\"fill_color\":{\"value\":\"olive\"},\"plot\":{\"id\":\"9b5b4f48-6165-40e4-94cd-678c208eca72\",\"subtype\":\"Figure\",\"type\":\"Plot\"}},\"id\":\"f8429220-0abf-4415-b4c1-ccf7cf44a484\",\"type\":\"BoxAnnotation\"},{\"attributes\":{},\"id\":\"30c720f8-3eb3-4a6c-93a6-d1150aff8121\",\"type\":\"BasicTicker\"},{\"attributes\":{},\"id\":\"40386f16-14cb-4b4a-8647-de6dfeb84c8c\",\"type\":\"BasicTickFormatter\"},{\"attributes\":{\"formatter\":{\"id\":\"0c62ad43-b2d1-43cb-b2fe-fadb49937eb3\",\"type\":\"BasicTickFormatter\"},\"plot\":{\"id\":\"9b5b4f48-6165-40e4-94cd-678c208eca72\",\"subtype\":\"Figure\",\"type\":\"Plot\"},\"ticker\":{\"id\":\"75286e9a-a071-4236-b55f-a8bd06fe6232\",\"type\":\"BasicTicker\"}},\"id\":\"1528ef83-2c33-4b69-915b-2ac98dc663eb\",\"type\":\"LinearAxis\"},{\"attributes\":{},\"id\":\"0c62ad43-b2d1-43cb-b2fe-fadb49937eb3\",\"type\":\"BasicTickFormatter\"},{\"attributes\":{},\"id\":\"00409c2c-0f6a-49ad-8311-ddf2db8eb5c1\",\"type\":\"LinearScale\"},{\"attributes\":{},\"id\":\"75286e9a-a071-4236-b55f-a8bd06fe6232\",\"type\":\"BasicTicker\"},{\"attributes\":{\"dimension\":1,\"plot\":{\"id\":\"9b5b4f48-6165-40e4-94cd-678c208eca72\",\"subtype\":\"Figure\",\"type\":\"Plot\"},\"ticker\":{\"id\":\"75286e9a-a071-4236-b55f-a8bd06fe6232\",\"type\":\"BasicTicker\"}},\"id\":\"2c19d2b0-119f-4025-837a-291e3769a441\",\"type\":\"Grid\"},{\"attributes\":{\"line_alpha\":{\"value\":0.1},\"line_color\":{\"value\":\"#1f77b4\"},\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"fb2ae4af-beb0-43fe-b595-642010a7e2f2\",\"type\":\"Line\"},{\"attributes\":{\"callback\":null,\"column_names\":[\"x\",\"y\"],\"data\":{\"x\":{\"__ndarray__\":\"AAAAAAAAAACBhJ9ciLq5P4GEn1yIusk/YaN3ReZL0z+BhJ9ciLrZP9Gy4zmVFOA/YaN3ReZL4z/xkwtRN4PmP4GEn1yIuuk/EXUzaNnx7D/RsuM5lRTwPxmrrb89sPE/YaN3ReZL8z+pm0HLjuf0P/GTC1E3g/Y/OYzV1t8e+D+BhJ9ciLr5P8l8aeIwVvs/EXUzaNnx/D9Zbf3tgY3+P9Gy4zmVFABA9a7IfGniAEAZq62/PbABQD2nkgISfgJAYaN3ReZLA0CFn1yIuhkEQKmbQcuO5wRAzZcmDmO1BUDxkwtRN4MGQBWQ8JMLUQdAOYzV1t8eCEBdiLoZtOwIQIGEn1yIuglApYCEn1yICkDJfGniMFYLQO14TiUFJAxAEXUzaNnxDEA1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j+DLE+wFIzsP22akmSV2u0/o0SilfTb7j/MUjFQmY3vP3QWx5247e8/TNCHJlr77z8eY9SyWrbvP68+R4ZsH+8/em4jkxU47j+auduKqwLtPwrA3NVNgus/fbsvgt266T89AM4987DnP072iXbTaeU/0Pg7vmDr4j9x+luWDDzgP7zPoJSNxdo/DLrpBtfN1D/1+5gUwUDNP+qf1AdAmsA/theArs9Gnj9aE9OApiSyv0nBo3YQ1sW/nmgvi7Ew0b+DIp0l8UnXv8xCZV8FJ92/jrzgAGRc4b+9mha3avjjvxDluuXYYOa/z/f97XWP6L+iqpKRnn7qv/I9eINTKey/gKwzUUaL7b/H7xyD5KDuv/5MAddgZ++/kIRCfbrc779mI79Fwv/vvxvnJK8d0O+/7mfF0EdO778p55AckHvuv1XmbPwWWu2/M6elU8js67+VlKzyUzfqv3bLoxAkPui/gctS41EG5r8KmPxymJXjv4+oH8xF8uC/BXTAalVG3L9lymUnEl/Wv0AEjFQCPtC/k7Ftmvflw79e36K7BnKsv2DD4OpO/aY/hruvy0+Mwj+mLHIKYCnPP22ZZ+b2utU/64wZNRmp2z841R9V4qfgP5q819AvUOM/yPhiaZfG5T//wUZlvAToP1hY32XTBOo/cb3VX7HB6z/gPF312DbtPw==\",\"dtype\":\"float64\",\"shape\":[200]}}},\"id\":\"019062fe-83a9-40df-970a-37fc4b732e2b\",\"type\":\"ColumnDataSource\"},{\"attributes\":{},\"id\":\"cbe69094-77e3-453e-b94f-e73604a96afe\",\"type\":\"LinearScale\"},{\"attributes\":{\"bottom_units\":\"screen\",\"fill_alpha\":{\"value\":0.5},\"fill_color\":{\"value\":\"lightgrey\"},\"left_units\":\"screen\",\"level\":\"overlay\",\"line_alpha\":{\"value\":1.0},\"line_color\":{\"value\":\"black\"},\"line_dash\":[4,4],\"line_width\":{\"value\":2},\"plot\":null,\"render_mode\":\"css\",\"right_units\":\"screen\",\"top_units\":\"screen\"},\"id\":\"55692a25-ac20-47bc-ab6b-72b9eacf4e74\",\"type\":\"BoxAnnotation\"},{\"attributes\":{\"active_drag\":\"auto\",\"active_inspect\":\"auto\",\"active_scroll\":\"auto\",\"active_tap\":\"auto\",\"tools\":[{\"id\":\"f6a3b830-64fe-4c74-b3b3-a11bc5290d16\",\"type\":\"PanTool\"},{\"id\":\"0b13f732-7967-422f-bb56-9a5fa0eee775\",\"type\":\"WheelZoomTool\"},{\"id\":\"bb5665c3-4014-45ef-8b72-c44a45b881b1\",\"type\":\"BoxZoomTool\"},{\"id\":\"75d35973-a813-4b64-b2b1-00f56dbd0488\",\"type\":\"SaveTool\"},{\"id\":\"31bffd64-7083-43f1-aced-22815621bddc\",\"type\":\"ResetTool\"},{\"id\":\"ad7880d9-b9a4-453c-b1f4-5e012b329dae\",\"type\":\"HelpTool\"}]},\"id\":\"ad0193c1-836b-4e2f-ad71-e5f9a57daab5\",\"type\":\"Toolbar\"},{\"attributes\":{},\"id\":\"f6a3b830-64fe-4c74-b3b3-a11bc5290d16\",\"type\":\"PanTool\"},{\"attributes\":{\"callback\":null,\"end\":2,\"start\":-2},\"id\":\"3b7e0c3c-65d7-422b-9396-ffac538751ff\",\"type\":\"Range1d\"},{\"attributes\":{\"data_source\":{\"id\":\"019062fe-83a9-40df-970a-37fc4b732e2b\",\"type\":\"ColumnDataSource\"},\"glyph\":{\"id\":\"61b4d567-203b-43a5-b298-f73c03a45d13\",\"type\":\"Line\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"fb2ae4af-beb0-43fe-b595-642010a7e2f2\",\"type\":\"Line\"},\"selection_glyph\":null,\"view\":{\"id\":\"64081066-d333-45e5-8566-febbca2546a3\",\"type\":\"CDSView\"}},\"id\":\"89082f75-7eeb-440f-948a-c06c054d4438\",\"type\":\"GlyphRenderer\"},{\"attributes\":{},\"id\":\"0b13f732-7967-422f-bb56-9a5fa0eee775\",\"type\":\"WheelZoomTool\"},{\"attributes\":{\"below\":[{\"id\":\"c63b9f19-1906-467e-afce-ec81a5176ca9\",\"type\":\"LinearAxis\"}],\"left\":[{\"id\":\"1528ef83-2c33-4b69-915b-2ac98dc663eb\",\"type\":\"LinearAxis\"}],\"renderers\":[{\"id\":\"c63b9f19-1906-467e-afce-ec81a5176ca9\",\"type\":\"LinearAxis\"},{\"id\":\"9ddcdc85-a3b4-4772-9f69-cadca988f8dd\",\"type\":\"Grid\"},{\"id\":\"1528ef83-2c33-4b69-915b-2ac98dc663eb\",\"type\":\"LinearAxis\"},{\"id\":\"2c19d2b0-119f-4025-837a-291e3769a441\",\"type\":\"Grid\"},{\"id\":\"55692a25-ac20-47bc-ab6b-72b9eacf4e74\",\"type\":\"BoxAnnotation\"},{\"id\":\"89082f75-7eeb-440f-948a-c06c054d4438\",\"type\":\"GlyphRenderer\"},{\"id\":\"f8429220-0abf-4415-b4c1-ccf7cf44a484\",\"type\":\"BoxAnnotation\"},{\"id\":\"c093c659-f7da-4edf-9802-e8a2e6a88754\",\"type\":\"BoxAnnotation\"},{\"id\":\"1084b6bb-bf6c-4ecb-9bdc-83090467f289\",\"type\":\"BoxAnnotation\"}],\"title\":{\"id\":\"ce9e1a68-15a3-4750-aaf7-d999ead910c9\",\"type\":\"Title\"},\"toolbar\":{\"id\":\"ad0193c1-836b-4e2f-ad71-e5f9a57daab5\",\"type\":\"Toolbar\"},\"x_range\":{\"id\":\"d8bb454b-953f-4558-aeb4-fff75aed2c58\",\"type\":\"DataRange1d\"},\"x_scale\":{\"id\":\"cbe69094-77e3-453e-b94f-e73604a96afe\",\"type\":\"LinearScale\"},\"y_range\":{\"id\":\"3b7e0c3c-65d7-422b-9396-ffac538751ff\",\"type\":\"Range1d\"},\"y_scale\":{\"id\":\"00409c2c-0f6a-49ad-8311-ddf2db8eb5c1\",\"type\":\"LinearScale\"}},\"id\":\"9b5b4f48-6165-40e4-94cd-678c208eca72\",\"subtype\":\"Figure\",\"type\":\"Plot\"},{\"attributes\":{\"overlay\":{\"id\":\"55692a25-ac20-47bc-ab6b-72b9eacf4e74\",\"type\":\"BoxAnnotation\"}},\"id\":\"bb5665c3-4014-45ef-8b72-c44a45b881b1\",\"type\":\"BoxZoomTool\"},{\"attributes\":{},\"id\":\"75d35973-a813-4b64-b2b1-00f56dbd0488\",\"type\":\"SaveTool\"},{\"attributes\":{\"bottom\":-0.3,\"fill_alpha\":{\"value\":0.1},\"fill_color\":{\"value\":\"navy\"},\"left\":7,\"plot\":{\"id\":\"9b5b4f48-6165-40e4-94cd-678c208eca72\",\"subtype\":\"Figure\",\"type\":\"Plot\"},\"right\":12,\"top\":0.6},\"id\":\"1084b6bb-bf6c-4ecb-9bdc-83090467f289\",\"type\":\"BoxAnnotation\"},{\"attributes\":{},\"id\":\"31bffd64-7083-43f1-aced-22815621bddc\",\"type\":\"ResetTool\"}],\"root_ids\":[\"9b5b4f48-6165-40e4-94cd-678c208eca72\"]},\"title\":\"Bokeh Application\",\"version\":\"0.12.10\"}};\n",
       "    var render_items = [{\"docid\":\"b640d3c2-dfc9-44a9-aa00-1a43664c42e0\",\"elementid\":\"57e3b03e-11e9-46a9-b16a-0ad52d89b780\",\"modelid\":\"9b5b4f48-6165-40e4-94cd-678c208eca72\"}];\n",
       "\n",
       "    root.Bokeh.embed.embed_items(docs_json, render_items);\n",
       "  }\n",
       "\n",
       "  if (root.Bokeh !== undefined) {\n",
       "    embed_document(root);\n",
       "  } else {\n",
       "    var attempts = 0;\n",
       "    var timer = setInterval(function(root) {\n",
       "      if (root.Bokeh !== undefined) {\n",
       "        embed_document(root);\n",
       "        clearInterval(timer);\n",
       "      }\n",
       "      attempts++;\n",
       "      if (attempts > 100) {\n",
       "        console.log(\"Bokeh: ERROR: Unable to embed document because BokehJS library is missing\")\n",
       "        clearInterval(timer);\n",
       "      }\n",
       "    }, 10, root)\n",
       "  }\n",
       "})(window);"
      ],
      "application/vnd.bokehjs_exec.v0+json": ""
     },
     "metadata": {
      "application/vnd.bokehjs_exec.v0+json": {
       "id": "9b5b4f48-6165-40e4-94cd-678c208eca72"
      }
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "import numpy as np\n",
    "from bokeh.models.annotations import BoxAnnotation\n",
    "\n",
    "x = np.linspace(0, 20, 200)\n",
    "y = np.sin(x)\n",
    "\n",
    "p = figure(y_range=(-2, 2))\n",
    "p.line(x, y)\n",
    "\n",
    "# region that always fills the top of the plot\n",
    "upper = BoxAnnotation(bottom=1, fill_alpha=0.1, fill_color='olive')\n",
    "p.add_layout(upper)\n",
    "\n",
    "# region that always fills the bottom of the plot\n",
    "lower = BoxAnnotation(top=-1, fill_alpha=0.1, fill_color='firebrick')\n",
    "p.add_layout(lower)\n",
    "\n",
    "# a finite region\n",
    "center = BoxAnnotation(top=0.6, bottom=-0.3, left=7, right=12, fill_alpha=0.1, fill_color='navy')\n",
    "p.add_layout(center)\n",
    "\n",
    "show(p)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "# Exercise:\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "collapsed": true
   },
   "source": [
    "## Label（标签）\n",
    "\n",
    "`Label`注释允许您轻松地绘图中添加单个文本标签。要显示的位置和文本被通过`x`, `y`和`text`设置：\n",
    "\n",
    "```python\n",
    "Label(x=10, y=5, text=\"Some Label\")\n",
    "```\n",
    "\n",
    "默认单位是“data space”，但`x_units`和`y_units`可以设置为`\"screen\"`来用相对位置定位标签。标签还可以用`x_offset`和`y_offset`来设置相对于`x`和`y`的偏移距离以确定最终位置。\n",
    "\n",
    "`Label`对象具备标准的text，line（` border_line `）和fill（` background_fill `）属性。line和fill属性应用于文本周围的边界框：\n",
    "\n",
    "```python\n",
    "Label(x=10, y=5, text=\"Some Label\", text_font_size=\"12pt\", \n",
    "      border_line_color=\"red\", background_fill_color=\"blue\")\n",
    "```"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "\n",
       "<div class=\"bk-root\">\n",
       "    <div class=\"bk-plotdiv\" id=\"8261b3db-9908-4bef-94ae-64fbfb562231\"></div>\n",
       "</div>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "application/javascript": [
       "(function(root) {\n",
       "  function embed_document(root) {\n",
       "    var docs_json = {\"5c60cc57-df31-436a-b7fa-4081aa8fbb83\":{\"roots\":{\"references\":[{\"attributes\":{\"plot\":null,\"text\":\"\"},\"id\":\"95cb39fc-6815-41e8-bcfe-bcfa137a502e\",\"type\":\"Title\"},{\"attributes\":{\"formatter\":{\"id\":\"73488faa-3528-4816-9b25-ec1fa5e5a2f4\",\"type\":\"BasicTickFormatter\"},\"plot\":{\"id\":\"a5eed3a3-61a6-4f42-8d80-ed1179200b36\",\"subtype\":\"Figure\",\"type\":\"Plot\"},\"ticker\":{\"id\":\"1c48a8eb-36a8-4843-a3ab-98e493d1c3f8\",\"type\":\"BasicTicker\"}},\"id\":\"0085bc80-b208-4a40-9677-1375a0de410b\",\"type\":\"LinearAxis\"},{\"attributes\":{\"below\":[{\"id\":\"7b73c8bc-9a8c-4715-8fa3-e9c99e8547b8\",\"type\":\"LinearAxis\"}],\"left\":[{\"id\":\"0085bc80-b208-4a40-9677-1375a0de410b\",\"type\":\"LinearAxis\"}],\"renderers\":[{\"id\":\"7b73c8bc-9a8c-4715-8fa3-e9c99e8547b8\",\"type\":\"LinearAxis\"},{\"id\":\"b518e7d3-13a1-452a-84a6-96027eef3b82\",\"type\":\"Grid\"},{\"id\":\"0085bc80-b208-4a40-9677-1375a0de410b\",\"type\":\"LinearAxis\"},{\"id\":\"6e32104b-9f64-4c9b-82af-01bebce2b145\",\"type\":\"Grid\"},{\"id\":\"cc04032d-c5ee-44ac-ae38-a989c40b17c5\",\"type\":\"BoxAnnotation\"},{\"id\":\"cf953a8a-67e6-43df-a07e-d7a202ebc8c9\",\"type\":\"GlyphRenderer\"},{\"id\":\"559779e7-cd8e-465d-a095-0ac5af292ff6\",\"type\":\"Label\"}],\"title\":{\"id\":\"95cb39fc-6815-41e8-bcfe-bcfa137a502e\",\"type\":\"Title\"},\"toolbar\":{\"id\":\"931c479d-37b3-4eaa-8c8c-486c00c58149\",\"type\":\"Toolbar\"},\"x_range\":{\"id\":\"97f11d26-fb7d-4bf0-8d42-c1ee91e32ac1\",\"type\":\"Range1d\"},\"x_scale\":{\"id\":\"47349d49-b1d3-4c27-ada8-d855e99b84c7\",\"type\":\"LinearScale\"},\"y_range\":{\"id\":\"f47205a3-bcd3-4af9-9614-449183f98f84\",\"type\":\"Range1d\"},\"y_scale\":{\"id\":\"62a50b2a-b679-4a93-a686-582a122cc9d6\",\"type\":\"LinearScale\"}},\"id\":\"a5eed3a3-61a6-4f42-8d80-ed1179200b36\",\"subtype\":\"Figure\",\"type\":\"Plot\"},{\"attributes\":{\"fill_alpha\":{\"value\":0.1},\"fill_color\":{\"value\":\"#1f77b4\"},\"line_alpha\":{\"value\":0.1},\"line_color\":{\"value\":\"#1f77b4\"},\"size\":{\"units\":\"screen\",\"value\":10},\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"04f2f12a-3bbf-4472-a43d-7ef2879cba3b\",\"type\":\"Circle\"},{\"attributes\":{},\"id\":\"5fccdba3-415d-4a24-a7e5-04f251febd96\",\"type\":\"BasicTicker\"},{\"attributes\":{\"formatter\":{\"id\":\"ebd28e45-c239-4058-a2c5-b1e63fca23e3\",\"type\":\"BasicTickFormatter\"},\"plot\":{\"id\":\"a5eed3a3-61a6-4f42-8d80-ed1179200b36\",\"subtype\":\"Figure\",\"type\":\"Plot\"},\"ticker\":{\"id\":\"5fccdba3-415d-4a24-a7e5-04f251febd96\",\"type\":\"BasicTicker\"}},\"id\":\"7b73c8bc-9a8c-4715-8fa3-e9c99e8547b8\",\"type\":\"LinearAxis\"},{\"attributes\":{\"dimension\":1,\"plot\":{\"id\":\"a5eed3a3-61a6-4f42-8d80-ed1179200b36\",\"subtype\":\"Figure\",\"type\":\"Plot\"},\"ticker\":{\"id\":\"1c48a8eb-36a8-4843-a3ab-98e493d1c3f8\",\"type\":\"BasicTicker\"}},\"id\":\"6e32104b-9f64-4c9b-82af-01bebce2b145\",\"type\":\"Grid\"},{\"attributes\":{},\"id\":\"1c48a8eb-36a8-4843-a3ab-98e493d1c3f8\",\"type\":\"BasicTicker\"},{\"attributes\":{},\"id\":\"ebd28e45-c239-4058-a2c5-b1e63fca23e3\",\"type\":\"BasicTickFormatter\"},{\"attributes\":{\"fill_color\":{\"value\":\"olive\"},\"line_color\":{\"value\":\"olive\"},\"size\":{\"units\":\"screen\",\"value\":10},\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"859aa3a4-4794-4308-a3c3-6e2b03bd4191\",\"type\":\"Circle\"},{\"attributes\":{\"bottom_units\":\"screen\",\"fill_alpha\":{\"value\":0.5},\"fill_color\":{\"value\":\"lightgrey\"},\"left_units\":\"screen\",\"level\":\"overlay\",\"line_alpha\":{\"value\":1.0},\"line_color\":{\"value\":\"black\"},\"line_dash\":[4,4],\"line_width\":{\"value\":2},\"plot\":null,\"render_mode\":\"css\",\"right_units\":\"screen\",\"top_units\":\"screen\"},\"id\":\"cc04032d-c5ee-44ac-ae38-a989c40b17c5\",\"type\":\"BoxAnnotation\"},{\"attributes\":{},\"id\":\"62a50b2a-b679-4a93-a686-582a122cc9d6\",\"type\":\"LinearScale\"},{\"attributes\":{},\"id\":\"406227b2-7a40-4f2a-a2e7-1be5e6171e47\",\"type\":\"PanTool\"},{\"attributes\":{\"active_drag\":\"auto\",\"active_inspect\":\"auto\",\"active_scroll\":\"auto\",\"active_tap\":\"auto\",\"tools\":[{\"id\":\"406227b2-7a40-4f2a-a2e7-1be5e6171e47\",\"type\":\"PanTool\"},{\"id\":\"192c4726-0ba4-4200-a522-0bb35240a12a\",\"type\":\"WheelZoomTool\"},{\"id\":\"2ed47f99-ac3b-4f34-bb89-99fe6f62ded7\",\"type\":\"BoxZoomTool\"},{\"id\":\"4314d2c2-3503-45af-8e60-849284ae521a\",\"type\":\"SaveTool\"},{\"id\":\"ec39ee51-3b80-4b1e-b2de-0de1cc39acd8\",\"type\":\"ResetTool\"},{\"id\":\"17d510da-372e-4b72-9f03-218438ab9284\",\"type\":\"HelpTool\"}]},\"id\":\"931c479d-37b3-4eaa-8c8c-486c00c58149\",\"type\":\"Toolbar\"},{\"attributes\":{\"source\":{\"id\":\"c43b1d66-88d1-492f-aff2-5c820a13e23d\",\"type\":\"ColumnDataSource\"}},\"id\":\"d1e4e02a-3651-41a4-9422-d5b909858adb\",\"type\":\"CDSView\"},{\"attributes\":{\"callback\":null,\"end\":10},\"id\":\"f47205a3-bcd3-4af9-9614-449183f98f84\",\"type\":\"Range1d\"},{\"attributes\":{\"data_source\":{\"id\":\"c43b1d66-88d1-492f-aff2-5c820a13e23d\",\"type\":\"ColumnDataSource\"},\"glyph\":{\"id\":\"859aa3a4-4794-4308-a3c3-6e2b03bd4191\",\"type\":\"Circle\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"04f2f12a-3bbf-4472-a43d-7ef2879cba3b\",\"type\":\"Circle\"},\"selection_glyph\":null,\"view\":{\"id\":\"d1e4e02a-3651-41a4-9422-d5b909858adb\",\"type\":\"CDSView\"}},\"id\":\"cf953a8a-67e6-43df-a07e-d7a202ebc8c9\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"plot\":{\"id\":\"a5eed3a3-61a6-4f42-8d80-ed1179200b36\",\"subtype\":\"Figure\",\"type\":\"Plot\"},\"text\":\"Second Point\",\"text_baseline\":\"middle\",\"x\":5,\"x_offset\":12,\"y\":7},\"id\":\"559779e7-cd8e-465d-a095-0ac5af292ff6\",\"type\":\"Label\"},{\"attributes\":{},\"id\":\"47349d49-b1d3-4c27-ada8-d855e99b84c7\",\"type\":\"LinearScale\"},{\"attributes\":{},\"id\":\"ec39ee51-3b80-4b1e-b2de-0de1cc39acd8\",\"type\":\"ResetTool\"},{\"attributes\":{\"callback\":null,\"end\":10},\"id\":\"97f11d26-fb7d-4bf0-8d42-c1ee91e32ac1\",\"type\":\"Range1d\"},{\"attributes\":{\"callback\":null,\"column_names\":[\"x\",\"y\"],\"data\":{\"x\":[2,5,8],\"y\":[4,7,6]}},\"id\":\"c43b1d66-88d1-492f-aff2-5c820a13e23d\",\"type\":\"ColumnDataSource\"},{\"attributes\":{\"overlay\":{\"id\":\"cc04032d-c5ee-44ac-ae38-a989c40b17c5\",\"type\":\"BoxAnnotation\"}},\"id\":\"2ed47f99-ac3b-4f34-bb89-99fe6f62ded7\",\"type\":\"BoxZoomTool\"},{\"attributes\":{},\"id\":\"192c4726-0ba4-4200-a522-0bb35240a12a\",\"type\":\"WheelZoomTool\"},{\"attributes\":{},\"id\":\"4314d2c2-3503-45af-8e60-849284ae521a\",\"type\":\"SaveTool\"},{\"attributes\":{},\"id\":\"17d510da-372e-4b72-9f03-218438ab9284\",\"type\":\"HelpTool\"},{\"attributes\":{},\"id\":\"73488faa-3528-4816-9b25-ec1fa5e5a2f4\",\"type\":\"BasicTickFormatter\"},{\"attributes\":{\"plot\":{\"id\":\"a5eed3a3-61a6-4f42-8d80-ed1179200b36\",\"subtype\":\"Figure\",\"type\":\"Plot\"},\"ticker\":{\"id\":\"5fccdba3-415d-4a24-a7e5-04f251febd96\",\"type\":\"BasicTicker\"}},\"id\":\"b518e7d3-13a1-452a-84a6-96027eef3b82\",\"type\":\"Grid\"}],\"root_ids\":[\"a5eed3a3-61a6-4f42-8d80-ed1179200b36\"]},\"title\":\"Bokeh Application\",\"version\":\"0.12.10\"}};\n",
       "    var render_items = [{\"docid\":\"5c60cc57-df31-436a-b7fa-4081aa8fbb83\",\"elementid\":\"8261b3db-9908-4bef-94ae-64fbfb562231\",\"modelid\":\"a5eed3a3-61a6-4f42-8d80-ed1179200b36\"}];\n",
       "\n",
       "    root.Bokeh.embed.embed_items(docs_json, render_items);\n",
       "  }\n",
       "\n",
       "  if (root.Bokeh !== undefined) {\n",
       "    embed_document(root);\n",
       "  } else {\n",
       "    var attempts = 0;\n",
       "    var timer = setInterval(function(root) {\n",
       "      if (root.Bokeh !== undefined) {\n",
       "        embed_document(root);\n",
       "        clearInterval(timer);\n",
       "      }\n",
       "      attempts++;\n",
       "      if (attempts > 100) {\n",
       "        console.log(\"Bokeh: ERROR: Unable to embed document because BokehJS library is missing\")\n",
       "        clearInterval(timer);\n",
       "      }\n",
       "    }, 10, root)\n",
       "  }\n",
       "})(window);"
      ],
      "application/vnd.bokehjs_exec.v0+json": ""
     },
     "metadata": {
      "application/vnd.bokehjs_exec.v0+json": {
       "id": "a5eed3a3-61a6-4f42-8d80-ed1179200b36"
      }
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "from bokeh.models.annotations import Label\n",
    "from bokeh.plotting import figure\n",
    "\n",
    "p = figure(x_range=(0,10), y_range=(0,10))\n",
    "p.circle([2, 5, 8], [4, 7, 6], color=\"olive\", size=10)\n",
    "\n",
    "label = Label(x=5, y=7, x_offset=12, text=\"Second Point\", text_baseline=\"middle\")\n",
    "p.add_layout(label)\n",
    "\n",
    "show(p)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "# EXERCISE: experiment with Label\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "collapsed": true
   },
   "source": [
    "## LabelSet（标签集）\n",
    "\n",
    "`LabelSet`注释允许您一次创建许多标签，例如，给一系列标记符号创建标签注释。其与`Label`类似，不同之处是接受`ColumnDataSource`类型数据为 `source`属性，而且`x`和`y`指向数据源的列，例如`x=\"col2\"`（但也可以是固定值，如`x=10`）。"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "\n",
       "<div class=\"bk-root\">\n",
       "    <div class=\"bk-plotdiv\" id=\"de61b5bd-94af-4abf-9ec9-7a27dc128c5b\"></div>\n",
       "</div>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "application/javascript": [
       "(function(root) {\n",
       "  function embed_document(root) {\n",
       "    var docs_json = {\"3b266070-b3c5-4e86-bbd0-fd1ef94cd211\":{\"roots\":{\"references\":[{\"attributes\":{\"plot\":null,\"text\":\"\"},\"id\":\"f5d64536-4a4e-4de1-b35e-3e4d25e33b38\",\"type\":\"Title\"},{\"attributes\":{\"source\":{\"id\":\"9a2f04b6-ed17-4b5a-925e-e122ca6acb8c\",\"type\":\"ColumnDataSource\"}},\"id\":\"16d96e90-b0e0-4692-ab47-cb61bce219b5\",\"type\":\"CDSView\"},{\"attributes\":{},\"id\":\"019f9051-a3e6-4e05-92ee-f772f6da7936\",\"type\":\"BasicTicker\"},{\"attributes\":{\"level\":\"glyph\",\"plot\":{\"id\":\"ab0b27e4-4774-4a2d-b396-9c08597e159e\",\"subtype\":\"Figure\",\"type\":\"Plot\"},\"source\":{\"id\":\"9a2f04b6-ed17-4b5a-925e-e122ca6acb8c\",\"type\":\"ColumnDataSource\"},\"text\":{\"field\":\"names\"},\"x\":{\"field\":\"temp\"},\"x_offset\":{\"value\":5},\"y\":{\"field\":\"pressure\"},\"y_offset\":{\"value\":5}},\"id\":\"73dde6f1-94d8-4f14-9fe2-4e15206d164a\",\"type\":\"LabelSet\"},{\"attributes\":{\"fill_color\":{\"value\":\"#1f77b4\"},\"line_color\":{\"value\":\"#1f77b4\"},\"size\":{\"units\":\"screen\",\"value\":8},\"x\":{\"field\":\"temp\"},\"y\":{\"field\":\"pressure\"}},\"id\":\"ad35c5dd-d14b-4c30-859f-5b326401eec4\",\"type\":\"Circle\"},{\"attributes\":{},\"id\":\"39f20292-875f-4f4a-afd6-189c65394a7a\",\"type\":\"BasicTickFormatter\"},{\"attributes\":{\"plot\":{\"id\":\"ab0b27e4-4774-4a2d-b396-9c08597e159e\",\"subtype\":\"Figure\",\"type\":\"Plot\"},\"ticker\":{\"id\":\"019f9051-a3e6-4e05-92ee-f772f6da7936\",\"type\":\"BasicTicker\"}},\"id\":\"a32a3a00-50a2-49aa-864f-dc3fcd02834c\",\"type\":\"Grid\"},{\"attributes\":{\"callback\":null,\"end\":175,\"start\":160},\"id\":\"6533060d-0308-4ab2-8f01-c099ccc1a544\",\"type\":\"Range1d\"},{\"attributes\":{\"axis_label\":\"Pressure (lbs)\",\"formatter\":{\"id\":\"ad592553-129e-42ae-b1a0-829aca7fbff0\",\"type\":\"BasicTickFormatter\"},\"plot\":{\"id\":\"ab0b27e4-4774-4a2d-b396-9c08597e159e\",\"subtype\":\"Figure\",\"type\":\"Plot\"},\"ticker\":{\"id\":\"ae5435dd-36cb-409d-9f95-aab485b14ee9\",\"type\":\"BasicTicker\"}},\"id\":\"b38882d2-856e-4a32-9db9-6c8b92ca6b2f\",\"type\":\"LinearAxis\"},{\"attributes\":{},\"id\":\"ad592553-129e-42ae-b1a0-829aca7fbff0\",\"type\":\"BasicTickFormatter\"},{\"attributes\":{},\"id\":\"ae5435dd-36cb-409d-9f95-aab485b14ee9\",\"type\":\"BasicTicker\"},{\"attributes\":{\"dimension\":1,\"plot\":{\"id\":\"ab0b27e4-4774-4a2d-b396-9c08597e159e\",\"subtype\":\"Figure\",\"type\":\"Plot\"},\"ticker\":{\"id\":\"ae5435dd-36cb-409d-9f95-aab485b14ee9\",\"type\":\"BasicTicker\"}},\"id\":\"b1d7d5bc-e5e3-4597-ad2f-c03fdbe29745\",\"type\":\"Grid\"},{\"attributes\":{\"fill_alpha\":{\"value\":0.1},\"fill_color\":{\"value\":\"#1f77b4\"},\"line_alpha\":{\"value\":0.1},\"line_color\":{\"value\":\"#1f77b4\"},\"size\":{\"units\":\"screen\",\"value\":8},\"x\":{\"field\":\"temp\"},\"y\":{\"field\":\"pressure\"}},\"id\":\"cfbd9db5-b85a-45b0-955c-2ad910e7ef6b\",\"type\":\"Circle\"},{\"attributes\":{},\"id\":\"c8f30e49-246e-4bd2-aa28-eb4b2cd215b7\",\"type\":\"LinearScale\"},{\"attributes\":{\"bottom_units\":\"screen\",\"fill_alpha\":{\"value\":0.5},\"fill_color\":{\"value\":\"lightgrey\"},\"left_units\":\"screen\",\"level\":\"overlay\",\"line_alpha\":{\"value\":1.0},\"line_color\":{\"value\":\"black\"},\"line_dash\":[4,4],\"line_width\":{\"value\":2},\"plot\":null,\"render_mode\":\"css\",\"right_units\":\"screen\",\"top_units\":\"screen\"},\"id\":\"e50de652-9a1e-4f61-964c-f0c6d8374db2\",\"type\":\"BoxAnnotation\"},{\"attributes\":{\"active_drag\":\"auto\",\"active_inspect\":\"auto\",\"active_scroll\":\"auto\",\"active_tap\":\"auto\",\"tools\":[{\"id\":\"f68660b9-0201-4dbb-9cab-08cfd793166a\",\"type\":\"PanTool\"},{\"id\":\"648f0f4c-1dbb-4ad5-b860-4d1b2c31d999\",\"type\":\"WheelZoomTool\"},{\"id\":\"03b0b724-240e-471f-97ac-2786017c8d80\",\"type\":\"BoxZoomTool\"},{\"id\":\"8adf52b0-87e4-4529-89e1-4cda5fb516fd\",\"type\":\"SaveTool\"},{\"id\":\"04474477-dc64-4752-9240-7b47f86724d2\",\"type\":\"ResetTool\"},{\"id\":\"427f5cc5-d181-4277-bfbf-d0a3785c03fb\",\"type\":\"HelpTool\"}]},\"id\":\"fd9be45d-130e-4afa-a5a2-7d8d428377f1\",\"type\":\"Toolbar\"},{\"attributes\":{},\"id\":\"f68660b9-0201-4dbb-9cab-08cfd793166a\",\"type\":\"PanTool\"},{\"attributes\":{\"axis_label\":\"Temperature (C)\",\"formatter\":{\"id\":\"39f20292-875f-4f4a-afd6-189c65394a7a\",\"type\":\"BasicTickFormatter\"},\"plot\":{\"id\":\"ab0b27e4-4774-4a2d-b396-9c08597e159e\",\"subtype\":\"Figure\",\"type\":\"Plot\"},\"ticker\":{\"id\":\"019f9051-a3e6-4e05-92ee-f772f6da7936\",\"type\":\"BasicTicker\"}},\"id\":\"9653ed58-e662-4199-826e-ebd38a89e2b8\",\"type\":\"LinearAxis\"},{\"attributes\":{\"data_source\":{\"id\":\"9a2f04b6-ed17-4b5a-925e-e122ca6acb8c\",\"type\":\"ColumnDataSource\"},\"glyph\":{\"id\":\"ad35c5dd-d14b-4c30-859f-5b326401eec4\",\"type\":\"Circle\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"cfbd9db5-b85a-45b0-955c-2ad910e7ef6b\",\"type\":\"Circle\"},\"selection_glyph\":null,\"view\":{\"id\":\"16d96e90-b0e0-4692-ab47-cb61bce219b5\",\"type\":\"CDSView\"}},\"id\":\"40048b9c-1422-4a72-8e6b-43e62125a98d\",\"type\":\"GlyphRenderer\"},{\"attributes\":{},\"id\":\"648f0f4c-1dbb-4ad5-b860-4d1b2c31d999\",\"type\":\"WheelZoomTool\"},{\"attributes\":{\"callback\":null},\"id\":\"1756f575-d571-4689-b8f7-4dc1731404b2\",\"type\":\"DataRange1d\"},{\"attributes\":{\"callback\":null,\"column_names\":[\"temp\",\"pressure\",\"names\"],\"data\":{\"names\":[\"A\",\"B\",\"C\",\"D\",\"E\",\"F\"],\"pressure\":[165,189,220,141,260,174],\"temp\":[166,171,172,168,174,162]}},\"id\":\"9a2f04b6-ed17-4b5a-925e-e122ca6acb8c\",\"type\":\"ColumnDataSource\"},{\"attributes\":{\"overlay\":{\"id\":\"e50de652-9a1e-4f61-964c-f0c6d8374db2\",\"type\":\"BoxAnnotation\"}},\"id\":\"03b0b724-240e-471f-97ac-2786017c8d80\",\"type\":\"BoxZoomTool\"},{\"attributes\":{},\"id\":\"8adf52b0-87e4-4529-89e1-4cda5fb516fd\",\"type\":\"SaveTool\"},{\"attributes\":{\"below\":[{\"id\":\"9653ed58-e662-4199-826e-ebd38a89e2b8\",\"type\":\"LinearAxis\"}],\"left\":[{\"id\":\"b38882d2-856e-4a32-9db9-6c8b92ca6b2f\",\"type\":\"LinearAxis\"}],\"renderers\":[{\"id\":\"9653ed58-e662-4199-826e-ebd38a89e2b8\",\"type\":\"LinearAxis\"},{\"id\":\"a32a3a00-50a2-49aa-864f-dc3fcd02834c\",\"type\":\"Grid\"},{\"id\":\"b38882d2-856e-4a32-9db9-6c8b92ca6b2f\",\"type\":\"LinearAxis\"},{\"id\":\"b1d7d5bc-e5e3-4597-ad2f-c03fdbe29745\",\"type\":\"Grid\"},{\"id\":\"e50de652-9a1e-4f61-964c-f0c6d8374db2\",\"type\":\"BoxAnnotation\"},{\"id\":\"40048b9c-1422-4a72-8e6b-43e62125a98d\",\"type\":\"GlyphRenderer\"},{\"id\":\"73dde6f1-94d8-4f14-9fe2-4e15206d164a\",\"type\":\"LabelSet\"}],\"title\":{\"id\":\"f5d64536-4a4e-4de1-b35e-3e4d25e33b38\",\"type\":\"Title\"},\"toolbar\":{\"id\":\"fd9be45d-130e-4afa-a5a2-7d8d428377f1\",\"type\":\"Toolbar\"},\"x_range\":{\"id\":\"6533060d-0308-4ab2-8f01-c099ccc1a544\",\"type\":\"Range1d\"},\"x_scale\":{\"id\":\"7cbb0a9c-8a3f-496d-9e05-43bd43f727fd\",\"type\":\"LinearScale\"},\"y_range\":{\"id\":\"1756f575-d571-4689-b8f7-4dc1731404b2\",\"type\":\"DataRange1d\"},\"y_scale\":{\"id\":\"c8f30e49-246e-4bd2-aa28-eb4b2cd215b7\",\"type\":\"LinearScale\"}},\"id\":\"ab0b27e4-4774-4a2d-b396-9c08597e159e\",\"subtype\":\"Figure\",\"type\":\"Plot\"},{\"attributes\":{},\"id\":\"7cbb0a9c-8a3f-496d-9e05-43bd43f727fd\",\"type\":\"LinearScale\"},{\"attributes\":{},\"id\":\"04474477-dc64-4752-9240-7b47f86724d2\",\"type\":\"ResetTool\"},{\"attributes\":{},\"id\":\"427f5cc5-d181-4277-bfbf-d0a3785c03fb\",\"type\":\"HelpTool\"}],\"root_ids\":[\"ab0b27e4-4774-4a2d-b396-9c08597e159e\"]},\"title\":\"Bokeh Application\",\"version\":\"0.12.10\"}};\n",
       "    var render_items = [{\"docid\":\"3b266070-b3c5-4e86-bbd0-fd1ef94cd211\",\"elementid\":\"de61b5bd-94af-4abf-9ec9-7a27dc128c5b\",\"modelid\":\"ab0b27e4-4774-4a2d-b396-9c08597e159e\"}];\n",
       "\n",
       "    root.Bokeh.embed.embed_items(docs_json, render_items);\n",
       "  }\n",
       "\n",
       "  if (root.Bokeh !== undefined) {\n",
       "    embed_document(root);\n",
       "  } else {\n",
       "    var attempts = 0;\n",
       "    var timer = setInterval(function(root) {\n",
       "      if (root.Bokeh !== undefined) {\n",
       "        embed_document(root);\n",
       "        clearInterval(timer);\n",
       "      }\n",
       "      attempts++;\n",
       "      if (attempts > 100) {\n",
       "        console.log(\"Bokeh: ERROR: Unable to embed document because BokehJS library is missing\")\n",
       "        clearInterval(timer);\n",
       "      }\n",
       "    }, 10, root)\n",
       "  }\n",
       "})(window);"
      ],
      "application/vnd.bokehjs_exec.v0+json": ""
     },
     "metadata": {
      "application/vnd.bokehjs_exec.v0+json": {
       "id": "ab0b27e4-4774-4a2d-b396-9c08597e159e"
      }
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "from bokeh.plotting import figure\n",
    "from bokeh.models import ColumnDataSource, LabelSet\n",
    "\n",
    "\n",
    "source = ColumnDataSource(data=dict(\n",
    "    temp=[166, 171, 172, 168, 174, 162],\n",
    "    pressure=[165, 189, 220, 141, 260, 174],\n",
    "    names=['A', 'B', 'C', 'D', 'E', 'F']))\n",
    "\n",
    "p = figure(x_range=(160, 175))\n",
    "p.scatter(x='temp', y='pressure', size=8, source=source)\n",
    "p.xaxis.axis_label = 'Temperature (C)'\n",
    "p.yaxis.axis_label = 'Pressure (lbs)'\n",
    "\n",
    "labels = LabelSet(x='temp', y='pressure', text='names', level='glyph',\n",
    "                  x_offset=5, y_offset=5, source=source, render_mode='canvas')\n",
    "\n",
    "\n",
    "p.add_layout(labels)\n",
    "\n",
    "show(p)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "# EXERCISE: experiment with LabelSet\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "collapsed": true
   },
   "source": [
    "## Arrows（箭头）\n",
    "\n",
    "`Arrow` 注释允许您在图中 “指向” 不同的东西，而且结合 label 标签使用特别有用。\n",
    "\n",
    "例如，创建一个箭头，从点（0,0）指向点（1,1）：\n",
    "\n",
    "```python\n",
    "p.add_layout(Arrow(x_start=0, y_start=0, x_end=1, y_end=0))\n",
    "```\n",
    "\n",
    "这个箭头是缺省的指向箭头尾端的 [`OpenHead`](http://bokeh.pydata.org/en/latest/docs/reference/models/arrow_heads.html#bokeh.models.arrow_heads.OpenHead) 箭头。其他种类的箭头包括 [`NormalHead`](http://bokeh.pydata.org/en/latest/docs/reference/models/arrow_heads.html#bokeh.models.arrow_heads.NormalHead) 和 [`VeeHead`](http://bokeh.pydata.org/en/latest/docs/reference/models/arrow_heads.html#bokeh.models.arrow_heads.VeeHead)。箭头头部类型可以通过设置 `Arrow` 对象的 `start` 和 `end` 属性设置：\n",
    "\n",
    "```python\n",
    "p.add_layout(Arrow(start=OpenHead(), end=VeeHead(), \n",
    "             x_start=0, y_start=0, x_end=1, y_end=0))\n",
    "```\n",
    "\n",
    "这将创建一个双端箭头，箭头是“open”类型，箭尾是“Vee”类型。箭头部可通过line和fill的标准属性设置来控制其外观。看一个例子\n",
    "\n",
    "```python\n",
    "OpenHead(line_color=\"firebrick\", line_width=4)\n",
    "```\n",
    "\n",
    "以下代码和图表集中展示了其中一些属性的设置。"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "\n",
       "<div class=\"bk-root\">\n",
       "    <div class=\"bk-plotdiv\" id=\"170e9d35-ab7b-4114-9c41-54d6fafbbf64\"></div>\n",
       "</div>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "application/javascript": [
       "(function(root) {\n",
       "  function embed_document(root) {\n",
       "    var docs_json = {\"175ca829-cda6-4235-8398-f1b59d2d0c55\":{\"roots\":{\"references\":[{\"attributes\":{},\"id\":\"80968461-be93-42b0-acf1-c2610c199019\",\"type\":\"LinearScale\"},{\"attributes\":{\"plot\":null,\"size\":35},\"id\":\"142f4898-3d9d-435c-af00-f8f6cd4aff4a\",\"type\":\"VeeHead\"},{\"attributes\":{\"below\":[{\"id\":\"9511f066-eb93-431c-b73d-b5ae957925f3\",\"type\":\"LinearAxis\"}],\"left\":[{\"id\":\"b5453abc-4129-4846-82af-b24b141f212c\",\"type\":\"LinearAxis\"}],\"renderers\":[{\"id\":\"9511f066-eb93-431c-b73d-b5ae957925f3\",\"type\":\"LinearAxis\"},{\"id\":\"12189a3f-f0b6-4fd2-8265-bec388810eca\",\"type\":\"Grid\"},{\"id\":\"b5453abc-4129-4846-82af-b24b141f212c\",\"type\":\"LinearAxis\"},{\"id\":\"021e6157-a6c0-44e5-bd2d-bcf356f43da3\",\"type\":\"Grid\"},{\"id\":\"489d0279-c440-4454-bac5-4836fb67a77b\",\"type\":\"BoxAnnotation\"},{\"id\":\"d1cb0f0b-3ac7-47fc-9b27-e28d210bba05\",\"type\":\"GlyphRenderer\"},{\"id\":\"7ff625b2-c36b-43fc-b503-e93c1ea1d35b\",\"type\":\"Arrow\"},{\"id\":\"8a4dc6cc-a645-4c16-be84-41a24080ce09\",\"type\":\"Arrow\"},{\"id\":\"33ba855d-d097-439a-90f6-4e035f75f297\",\"type\":\"Arrow\"}],\"title\":{\"id\":\"4caa9253-be40-481e-a6ca-1cdfdb356376\",\"type\":\"Title\"},\"toolbar\":{\"id\":\"e73afc47-76cc-4f6b-b373-0ae4049a4424\",\"type\":\"Toolbar\"},\"x_range\":{\"id\":\"daa3d083-1667-4560-9e9a-7555a22a5337\",\"type\":\"DataRange1d\"},\"x_scale\":{\"id\":\"fe970553-36cf-4985-8f6a-15a96060d0db\",\"type\":\"LinearScale\"},\"y_range\":{\"id\":\"d5f7048a-641f-422d-9e03-09f8fc45a726\",\"type\":\"DataRange1d\"},\"y_scale\":{\"id\":\"80968461-be93-42b0-acf1-c2610c199019\",\"type\":\"LinearScale\"}},\"id\":\"b942d118-a87d-47a5-bf0b-1975b0cc7638\",\"subtype\":\"Figure\",\"type\":\"Plot\"},{\"attributes\":{},\"id\":\"4bb95e6e-c17f-4f36-82ea-247a00f34735\",\"type\":\"BasicTickFormatter\"},{\"attributes\":{\"data_source\":{\"id\":\"a1dde8b9-aef4-4317-a4aa-1486e43b5b9d\",\"type\":\"ColumnDataSource\"},\"glyph\":{\"id\":\"10f48032-6946-4fcb-b9a2-5b98519042e7\",\"type\":\"Circle\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"82a74513-c3aa-4136-9d69-b293a7ce4a88\",\"type\":\"Circle\"},\"selection_glyph\":null,\"view\":{\"id\":\"46433b42-510b-4f01-945d-1344ade640ef\",\"type\":\"CDSView\"}},\"id\":\"d1cb0f0b-3ac7-47fc-9b27-e28d210bba05\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"callback\":null,\"column_names\":[\"x\",\"y\",\"fill_color\",\"line_color\"],\"data\":{\"fill_color\":[\"navy\",\"yellow\",\"red\"],\"line_color\":[\"navy\",\"yellow\",\"red\"],\"x\":[0,1,0.5],\"y\":[0,0,0.7]}},\"id\":\"a1dde8b9-aef4-4317-a4aa-1486e43b5b9d\",\"type\":\"ColumnDataSource\"},{\"attributes\":{\"callback\":null},\"id\":\"daa3d083-1667-4560-9e9a-7555a22a5337\",\"type\":\"DataRange1d\"},{\"attributes\":{\"active_drag\":\"auto\",\"active_inspect\":\"auto\",\"active_scroll\":\"auto\",\"active_tap\":\"auto\",\"tools\":[{\"id\":\"734407ec-c732-4ab9-a1a4-92c3079e1dde\",\"type\":\"PanTool\"},{\"id\":\"5e322d08-8c92-422e-97f0-1c56560c4d1b\",\"type\":\"WheelZoomTool\"},{\"id\":\"484190d5-d4de-465d-b958-2c5fa3e695b0\",\"type\":\"BoxZoomTool\"},{\"id\":\"30fb2f02-0321-4f60-a4d1-f7e992cd85f0\",\"type\":\"SaveTool\"},{\"id\":\"1c3a4081-7396-42d9-829a-01dd2c59c9ee\",\"type\":\"ResetTool\"},{\"id\":\"3846676d-4a9f-4f73-b86a-677b6c7f326a\",\"type\":\"HelpTool\"}]},\"id\":\"e73afc47-76cc-4f6b-b373-0ae4049a4424\",\"type\":\"Toolbar\"},{\"attributes\":{},\"id\":\"3846676d-4a9f-4f73-b86a-677b6c7f326a\",\"type\":\"HelpTool\"},{\"attributes\":{},\"id\":\"fe970553-36cf-4985-8f6a-15a96060d0db\",\"type\":\"LinearScale\"},{\"attributes\":{\"callback\":null},\"id\":\"d5f7048a-641f-422d-9e03-09f8fc45a726\",\"type\":\"DataRange1d\"},{\"attributes\":{\"overlay\":{\"id\":\"489d0279-c440-4454-bac5-4836fb67a77b\",\"type\":\"BoxAnnotation\"}},\"id\":\"484190d5-d4de-465d-b958-2c5fa3e695b0\",\"type\":\"BoxZoomTool\"},{\"attributes\":{\"fill_alpha\":{\"value\":0.1},\"fill_color\":{\"value\":\"#1f77b4\"},\"line_alpha\":{\"value\":0.1},\"line_color\":{\"value\":\"#1f77b4\"},\"radius\":{\"units\":\"data\",\"value\":0.1},\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"82a74513-c3aa-4136-9d69-b293a7ce4a88\",\"type\":\"Circle\"},{\"attributes\":{\"plot\":{\"id\":\"b942d118-a87d-47a5-bf0b-1975b0cc7638\",\"subtype\":\"Figure\",\"type\":\"Plot\"},\"ticker\":{\"id\":\"ded122ec-fc55-4b09-a14f-28db4439f58e\",\"type\":\"BasicTicker\"}},\"id\":\"12189a3f-f0b6-4fd2-8265-bec388810eca\",\"type\":\"Grid\"},{\"attributes\":{},\"id\":\"30fb2f02-0321-4f60-a4d1-f7e992cd85f0\",\"type\":\"SaveTool\"},{\"attributes\":{\"fill_alpha\":{\"value\":0.1},\"fill_color\":{\"field\":\"fill_color\"},\"line_color\":{\"field\":\"line_color\"},\"radius\":{\"units\":\"data\",\"value\":0.1},\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"10f48032-6946-4fcb-b9a2-5b98519042e7\",\"type\":\"Circle\"},{\"attributes\":{},\"id\":\"26f2ff8f-0daa-4ca1-97a6-5f3e6278be32\",\"type\":\"BasicTickFormatter\"},{\"attributes\":{\"formatter\":{\"id\":\"26f2ff8f-0daa-4ca1-97a6-5f3e6278be32\",\"type\":\"BasicTickFormatter\"},\"plot\":{\"id\":\"b942d118-a87d-47a5-bf0b-1975b0cc7638\",\"subtype\":\"Figure\",\"type\":\"Plot\"},\"ticker\":{\"id\":\"57edaafe-d621-4721-b3fc-7a504b238210\",\"type\":\"BasicTicker\"}},\"id\":\"b5453abc-4129-4846-82af-b24b141f212c\",\"type\":\"LinearAxis\"},{\"attributes\":{\"dimension\":1,\"plot\":{\"id\":\"b942d118-a87d-47a5-bf0b-1975b0cc7638\",\"subtype\":\"Figure\",\"type\":\"Plot\"},\"ticker\":{\"id\":\"57edaafe-d621-4721-b3fc-7a504b238210\",\"type\":\"BasicTicker\"}},\"id\":\"021e6157-a6c0-44e5-bd2d-bcf356f43da3\",\"type\":\"Grid\"},{\"attributes\":{},\"id\":\"57edaafe-d621-4721-b3fc-7a504b238210\",\"type\":\"BasicTicker\"},{\"attributes\":{\"bottom_units\":\"screen\",\"fill_alpha\":{\"value\":0.5},\"fill_color\":{\"value\":\"lightgrey\"},\"left_units\":\"screen\",\"level\":\"overlay\",\"line_alpha\":{\"value\":1.0},\"line_color\":{\"value\":\"black\"},\"line_dash\":[4,4],\"line_width\":{\"value\":2},\"plot\":null,\"render_mode\":\"css\",\"right_units\":\"screen\",\"top_units\":\"screen\"},\"id\":\"489d0279-c440-4454-bac5-4836fb67a77b\",\"type\":\"BoxAnnotation\"},{\"attributes\":{},\"id\":\"1c3a4081-7396-42d9-829a-01dd2c59c9ee\",\"type\":\"ResetTool\"},{\"attributes\":{\"end\":{\"id\":\"142f4898-3d9d-435c-af00-f8f6cd4aff4a\",\"type\":\"VeeHead\"},\"line_color\":{\"value\":\"red\"},\"plot\":{\"id\":\"b942d118-a87d-47a5-bf0b-1975b0cc7638\",\"subtype\":\"Figure\",\"type\":\"Plot\"},\"source\":null,\"start\":null,\"x_end\":{\"value\":0},\"x_start\":{\"value\":0.5},\"y_end\":{\"value\":0},\"y_start\":{\"value\":0.7}},\"id\":\"33ba855d-d097-439a-90f6-4e035f75f297\",\"type\":\"Arrow\"},{\"attributes\":{},\"id\":\"ded122ec-fc55-4b09-a14f-28db4439f58e\",\"type\":\"BasicTicker\"},{\"attributes\":{\"formatter\":{\"id\":\"4bb95e6e-c17f-4f36-82ea-247a00f34735\",\"type\":\"BasicTickFormatter\"},\"plot\":{\"id\":\"b942d118-a87d-47a5-bf0b-1975b0cc7638\",\"subtype\":\"Figure\",\"type\":\"Plot\"},\"ticker\":{\"id\":\"ded122ec-fc55-4b09-a14f-28db4439f58e\",\"type\":\"BasicTicker\"}},\"id\":\"9511f066-eb93-431c-b73d-b5ae957925f3\",\"type\":\"LinearAxis\"},{\"attributes\":{},\"id\":\"5e322d08-8c92-422e-97f0-1c56560c4d1b\",\"type\":\"WheelZoomTool\"},{\"attributes\":{\"end\":{\"id\":\"57847dc1-03d2-421e-8ff0-f448f2ed4be7\",\"type\":\"OpenHead\"},\"plot\":{\"id\":\"b942d118-a87d-47a5-bf0b-1975b0cc7638\",\"subtype\":\"Figure\",\"type\":\"Plot\"},\"source\":null,\"start\":null,\"x_end\":{\"value\":1},\"x_start\":{\"value\":0},\"y_end\":{\"value\":0},\"y_start\":{\"value\":0}},\"id\":\"7ff625b2-c36b-43fc-b503-e93c1ea1d35b\",\"type\":\"Arrow\"},{\"attributes\":{\"line_color\":{\"value\":\"firebrick\"},\"line_width\":{\"value\":4},\"plot\":null},\"id\":\"57847dc1-03d2-421e-8ff0-f448f2ed4be7\",\"type\":\"OpenHead\"},{\"attributes\":{\"end\":{\"id\":\"50477771-bb64-43e4-8858-9632d8afe233\",\"type\":\"NormalHead\"},\"plot\":{\"id\":\"b942d118-a87d-47a5-bf0b-1975b0cc7638\",\"subtype\":\"Figure\",\"type\":\"Plot\"},\"source\":null,\"start\":null,\"x_end\":{\"value\":0.5},\"x_start\":{\"value\":1},\"y_end\":{\"value\":0.7},\"y_start\":{\"value\":0}},\"id\":\"8a4dc6cc-a645-4c16-be84-41a24080ce09\",\"type\":\"Arrow\"},{\"attributes\":{},\"id\":\"734407ec-c732-4ab9-a1a4-92c3079e1dde\",\"type\":\"PanTool\"},{\"attributes\":{\"source\":{\"id\":\"a1dde8b9-aef4-4317-a4aa-1486e43b5b9d\",\"type\":\"ColumnDataSource\"}},\"id\":\"46433b42-510b-4f01-945d-1344ade640ef\",\"type\":\"CDSView\"},{\"attributes\":{\"fill_color\":{\"value\":\"orange\"},\"plot\":null},\"id\":\"50477771-bb64-43e4-8858-9632d8afe233\",\"type\":\"NormalHead\"},{\"attributes\":{\"plot\":null,\"text\":\"\"},\"id\":\"4caa9253-be40-481e-a6ca-1cdfdb356376\",\"type\":\"Title\"}],\"root_ids\":[\"b942d118-a87d-47a5-bf0b-1975b0cc7638\"]},\"title\":\"Bokeh Application\",\"version\":\"0.12.10\"}};\n",
       "    var render_items = [{\"docid\":\"175ca829-cda6-4235-8398-f1b59d2d0c55\",\"elementid\":\"170e9d35-ab7b-4114-9c41-54d6fafbbf64\",\"modelid\":\"b942d118-a87d-47a5-bf0b-1975b0cc7638\"}];\n",
       "\n",
       "    root.Bokeh.embed.embed_items(docs_json, render_items);\n",
       "  }\n",
       "\n",
       "  if (root.Bokeh !== undefined) {\n",
       "    embed_document(root);\n",
       "  } else {\n",
       "    var attempts = 0;\n",
       "    var timer = setInterval(function(root) {\n",
       "      if (root.Bokeh !== undefined) {\n",
       "        embed_document(root);\n",
       "        clearInterval(timer);\n",
       "      }\n",
       "      attempts++;\n",
       "      if (attempts > 100) {\n",
       "        console.log(\"Bokeh: ERROR: Unable to embed document because BokehJS library is missing\")\n",
       "        clearInterval(timer);\n",
       "      }\n",
       "    }, 10, root)\n",
       "  }\n",
       "})(window);"
      ],
      "application/vnd.bokehjs_exec.v0+json": ""
     },
     "metadata": {
      "application/vnd.bokehjs_exec.v0+json": {
       "id": "b942d118-a87d-47a5-bf0b-1975b0cc7638"
      }
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "from bokeh.models.annotations import Arrow\n",
    "from bokeh.models.arrow_heads import OpenHead, NormalHead, VeeHead\n",
    "\n",
    "p = figure(plot_width=600, plot_height=600)\n",
    "\n",
    "p.circle(x=[0, 1, 0.5], y=[0, 0, 0.7], radius=0.1,\n",
    "         color=[\"navy\", \"yellow\", \"red\"], fill_alpha=0.1)\n",
    "\n",
    "p.add_layout(Arrow(end=OpenHead(line_color=\"firebrick\", line_width=4),\n",
    "                   x_start=0, y_start=0, x_end=1, y_end=0))\n",
    "\n",
    "p.add_layout(Arrow(end=NormalHead(fill_color=\"orange\"),\n",
    "                   x_start=1, y_start=0, x_end=0.5, y_end=0.7))\n",
    "\n",
    "p.add_layout(Arrow(end=VeeHead(size=35), line_color=\"red\",\n",
    "                   x_start=0.5, y_start=0.7, x_end=0, y_end=0))\n",
    "\n",
    "show(p)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "# EXERCISE: experiment with arrows and arrow heads\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Legends（图例）"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Simple Legends（简单图例）"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "\n",
       "<div class=\"bk-root\">\n",
       "    <div class=\"bk-plotdiv\" id=\"1738cb4c-dfea-4e8c-afb9-86f99713b3c9\"></div>\n",
       "</div>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "application/javascript": [
       "(function(root) {\n",
       "  function embed_document(root) {\n",
       "    var docs_json = {\"87f145ba-0d85-428c-849b-c09c5c7b6478\":{\"roots\":{\"references\":[{\"attributes\":{},\"id\":\"075afb09-314b-4e78-9164-962cb667735f\",\"type\":\"HelpTool\"},{\"attributes\":{},\"id\":\"d66a2351-05cd-4b64-aa24-6c271c7d22f3\",\"type\":\"BasicTickFormatter\"},{\"attributes\":{},\"id\":\"b15d102b-9bbe-469b-89d5-c634b10d9788\",\"type\":\"LinearScale\"},{\"attributes\":{\"data_source\":{\"id\":\"bf70061b-efbd-44d2-b9ed-7bc043f7785b\",\"type\":\"ColumnDataSource\"},\"glyph\":{\"id\":\"9e0c409c-f9dd-4713-9b70-1023924d623c\",\"type\":\"Line\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"7aef1e13-379c-4fd5-93d3-547f24929a3c\",\"type\":\"Line\"},\"selection_glyph\":null,\"view\":{\"id\":\"5c7ccea6-af36-49f9-9b9c-4a8008e59175\",\"type\":\"CDSView\"}},\"id\":\"75795bbf-bd36-44e9-b776-fd66aaa96190\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"fill_alpha\":{\"value\":0.1},\"fill_color\":{\"value\":\"#1f77b4\"},\"line_alpha\":{\"value\":0.1},\"line_color\":{\"value\":\"#1f77b4\"},\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"4b306f4e-adad-4976-bd8d-cca6a4388c36\",\"type\":\"Circle\"},{\"attributes\":{},\"id\":\"9b97989d-9f25-4b54-8bb3-f8bf643b6583\",\"type\":\"SaveTool\"},{\"attributes\":{\"below\":[{\"id\":\"fd4545b0-2f46-464f-b391-2a3d95c98ec5\",\"type\":\"LinearAxis\"}],\"left\":[{\"id\":\"d9f6b8da-c311-46bc-8c59-26a1af583b34\",\"type\":\"LinearAxis\"}],\"plot_height\":400,\"renderers\":[{\"id\":\"fd4545b0-2f46-464f-b391-2a3d95c98ec5\",\"type\":\"LinearAxis\"},{\"id\":\"46068bea-8437-4149-903b-ea25348a8f49\",\"type\":\"Grid\"},{\"id\":\"d9f6b8da-c311-46bc-8c59-26a1af583b34\",\"type\":\"LinearAxis\"},{\"id\":\"aa2dcc91-78dd-42eb-896c-73165ada82cf\",\"type\":\"Grid\"},{\"id\":\"07053f44-cf66-47ab-a4a9-9d1a2c355cf1\",\"type\":\"BoxAnnotation\"},{\"id\":\"302d74ac-4b93-4264-8d84-f242d9f10b4b\",\"type\":\"Legend\"},{\"id\":\"080e2312-3dd1-405e-814c-0d6100e333f5\",\"type\":\"GlyphRenderer\"},{\"id\":\"75795bbf-bd36-44e9-b776-fd66aaa96190\",\"type\":\"GlyphRenderer\"}],\"title\":{\"id\":\"09dcee3c-32f3-4901-b715-0f8f172e20c3\",\"type\":\"Title\"},\"toolbar\":{\"id\":\"ce30546e-0172-411f-93a9-a222229490d9\",\"type\":\"Toolbar\"},\"x_range\":{\"id\":\"c4d35bf5-af04-487a-b8a0-c0b20bfe699a\",\"type\":\"DataRange1d\"},\"x_scale\":{\"id\":\"b15d102b-9bbe-469b-89d5-c634b10d9788\",\"type\":\"LinearScale\"},\"y_range\":{\"id\":\"2943ecc2-6922-4a86-8857-d86a5c04f4a8\",\"type\":\"DataRange1d\"},\"y_scale\":{\"id\":\"b4ea98e5-035b-4d35-becc-a29ad6c63031\",\"type\":\"LinearScale\"}},\"id\":\"5ebfe401-594a-428b-bfca-356069d2f1df\",\"subtype\":\"Figure\",\"type\":\"Plot\"},{\"attributes\":{\"callback\":null},\"id\":\"c4d35bf5-af04-487a-b8a0-c0b20bfe699a\",\"type\":\"DataRange1d\"},{\"attributes\":{\"data_source\":{\"id\":\"9b09b8d2-e15b-4d2a-bc17-16b8d467c238\",\"type\":\"ColumnDataSource\"},\"glyph\":{\"id\":\"c9d28f54-abe0-460f-9907-21a450b805b2\",\"type\":\"Circle\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"4b306f4e-adad-4976-bd8d-cca6a4388c36\",\"type\":\"Circle\"},\"selection_glyph\":null,\"view\":{\"id\":\"a35e7195-8b26-4518-be7e-42d37181884b\",\"type\":\"CDSView\"}},\"id\":\"080e2312-3dd1-405e-814c-0d6100e333f5\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"line_color\":{\"value\":\"orange\"},\"line_dash\":[4,4],\"line_width\":{\"value\":2},\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"9e0c409c-f9dd-4713-9b70-1023924d623c\",\"type\":\"Line\"},{\"attributes\":{\"bottom_units\":\"screen\",\"fill_alpha\":{\"value\":0.5},\"fill_color\":{\"value\":\"lightgrey\"},\"left_units\":\"screen\",\"level\":\"overlay\",\"line_alpha\":{\"value\":1.0},\"line_color\":{\"value\":\"black\"},\"line_dash\":[4,4],\"line_width\":{\"value\":2},\"plot\":null,\"render_mode\":\"css\",\"right_units\":\"screen\",\"top_units\":\"screen\"},\"id\":\"07053f44-cf66-47ab-a4a9-9d1a2c355cf1\",\"type\":\"BoxAnnotation\"},{\"attributes\":{},\"id\":\"e5c26a6a-23d8-4a8d-88a0-886f2eb4129e\",\"type\":\"PanTool\"},{\"attributes\":{\"fill_color\":{\"value\":\"#1f77b4\"},\"line_color\":{\"value\":\"#1f77b4\"},\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"c9d28f54-abe0-460f-9907-21a450b805b2\",\"type\":\"Circle\"},{\"attributes\":{\"callback\":null,\"column_names\":[\"x\",\"y\"],\"data\":{\"x\":{\"__ndarray__\":\"AAAAAAAAAACRGkt8Vz/AP5EaS3xXP9A/2qdwOgNf2D+RGkt8Vz/gPzXhXVstT+Q/2qdwOgNf6D9+boMZ2W7sP5EaS3xXP/A/433Ua0JH8j814V1bLU/0P4dE50oYV/Y/2qdwOgNf+D8sC/op7mb6P35ugxnZbvw/0NEMCcR2/j+RGkt8Vz8AQDrMD/RMQwFA433Ua0JHAkCML5njN0sDQDXhXVstTwRA3pIi0yJTBUCHROdKGFcGQDD2q8INWwdA2qdwOgNfCECDWTWy+G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/8qg+VZVT3T/4C4p0qOPVP+UppLIiM8w/3FNHxZdVuD/J23zJpD6gv+3ENsZjOcS/wo12/ecH0r/dgWKM2KjZv2MTsJELcOC/83ixWvXH47+358MBZM7mv5eCD4nhdum/rExY6Hq267+TIxAn7YPtvwSssILL1+6/70I4BJ6s77/vOc8G+P7vvzTGy1KGze+/3176khQZ77/C8a4NiuTtvzGcHq/dNOy/l0FFlgER6r+EGZN4xoHnvx8WPFK3keS/Cli7+O1M4b+HQNqEwoHbv9kfIiFb+NO/gKyggGI5yL8EhrXMjDywvyGGtcyMPLA/jqyggGI5yD/gHyIhW/jTP4BA2oTCgds/DVi7+O1M4T8cFjxSt5HkP4cZk3jGgec/lUFFlgER6j8ynB6v3TTsP8Hxrg2K5O0/4F76khQZ7z80xstShs3vP+85zwb4/u8/8EI4BJ6s7z8DrLCCy9fuP5UjECftg+0/p0xY6Hq26z+Vgg+J4XbpP7fnwwFkzuY/9nixWvXH4z9dE7CRC3DgP9eBYozYqNk/w412/ecH0j/+xDbGYznEP0/bfMmkPqA/+FNHxZdVuL/UKaSyIjPMv+gLinSo49W/+Kg+VZVT3b8lRkW6WiXiv8+HZvErVuW/pig6uxkv6L+TVimJaaTqv1EHwCL7q+y/xFNiW3I97r/Al/eBWVLvv2Zmsvw75u+/g6xao7j2778YHIGMi4Pvv/sjPCWPju6/EyzujrQb7b94zoZi8zDrv4xAIRwx1ui//Bc/lCAV5r9GhZoMGvnivx5NPurYHd+/65MNU1HJ17+SiNkBzxLQv/GDAnguNMC/B1wUMyamwbw=\",\"dtype\":\"float64\",\"shape\":[100]}}},\"id\":\"9b09b8d2-e15b-4d2a-bc17-16b8d467c238\",\"type\":\"ColumnDataSource\"},{\"attributes\":{\"label\":{\"value\":\"sin(x)\"},\"renderers\":[{\"id\":\"080e2312-3dd1-405e-814c-0d6100e333f5\",\"type\":\"GlyphRenderer\"}]},\"id\":\"5a62d6a5-6839-477b-8e81-94ed471b649d\",\"type\":\"LegendItem\"},{\"attributes\":{},\"id\":\"b4ea98e5-035b-4d35-becc-a29ad6c63031\",\"type\":\"LinearScale\"},{\"attributes\":{\"line_alpha\":{\"value\":0.1},\"line_color\":{\"value\":\"#1f77b4\"},\"line_dash\":[4,4],\"line_width\":{\"value\":2},\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"7aef1e13-379c-4fd5-93d3-547f24929a3c\",\"type\":\"Line\"},{\"attributes\":{\"dimension\":1,\"plot\":{\"id\":\"5ebfe401-594a-428b-bfca-356069d2f1df\",\"subtype\":\"Figure\",\"type\":\"Plot\"},\"ticker\":{\"id\":\"bc4ce936-107d-4650-ac0d-6f9adf9488d5\",\"type\":\"BasicTicker\"}},\"id\":\"aa2dcc91-78dd-42eb-896c-73165ada82cf\",\"type\":\"Grid\"},{\"attributes\":{},\"id\":\"af9c2ae7-4d9c-49ae-99f9-fb7ed1d8afd2\",\"type\":\"BasicTickFormatter\"},{\"attributes\":{},\"id\":\"bc4ce936-107d-4650-ac0d-6f9adf9488d5\",\"type\":\"BasicTicker\"},{\"attributes\":{\"source\":{\"id\":\"bf70061b-efbd-44d2-b9ed-7bc043f7785b\",\"type\":\"ColumnDataSource\"}},\"id\":\"5c7ccea6-af36-49f9-9b9c-4a8008e59175\",\"type\":\"CDSView\"},{\"attributes\":{\"plot\":{\"id\":\"5ebfe401-594a-428b-bfca-356069d2f1df\",\"subtype\":\"Figure\",\"type\":\"Plot\"},\"ticker\":{\"id\":\"e2a95058-38db-479f-ab39-34cb1e6ffbb4\",\"type\":\"BasicTicker\"}},\"id\":\"46068bea-8437-4149-903b-ea25348a8f49\",\"type\":\"Grid\"},{\"attributes\":{},\"id\":\"baba8b36-327e-4c5b-8e1c-d5772b3ca259\",\"type\":\"WheelZoomTool\"},{\"attributes\":{\"callback\":null},\"id\":\"2943ecc2-6922-4a86-8857-d86a5c04f4a8\",\"type\":\"DataRange1d\"},{\"attributes\":{\"items\":[{\"id\":\"5a62d6a5-6839-477b-8e81-94ed471b649d\",\"type\":\"LegendItem\"},{\"id\":\"9996a23e-e2de-4139-88e6-b5af004f15a4\",\"type\":\"LegendItem\"}],\"plot\":{\"id\":\"5ebfe401-594a-428b-bfca-356069d2f1df\",\"subtype\":\"Figure\",\"type\":\"Plot\"}},\"id\":\"302d74ac-4b93-4264-8d84-f242d9f10b4b\",\"type\":\"Legend\"},{\"attributes\":{},\"id\":\"1f6a7499-87b2-4db0-bfdc-ebdf3dda9513\",\"type\":\"ResetTool\"},{\"attributes\":{\"source\":{\"id\":\"9b09b8d2-e15b-4d2a-bc17-16b8d467c238\",\"type\":\"ColumnDataSource\"}},\"id\":\"a35e7195-8b26-4518-be7e-42d37181884b\",\"type\":\"CDSView\"},{\"attributes\":{\"overlay\":{\"id\":\"07053f44-cf66-47ab-a4a9-9d1a2c355cf1\",\"type\":\"BoxAnnotation\"}},\"id\":\"5ca683ac-d9f5-46e0-96f2-93ab57fdda01\",\"type\":\"BoxZoomTool\"},{\"attributes\":{\"active_drag\":\"auto\",\"active_inspect\":\"auto\",\"active_scroll\":\"auto\",\"active_tap\":\"auto\",\"tools\":[{\"id\":\"e5c26a6a-23d8-4a8d-88a0-886f2eb4129e\",\"type\":\"PanTool\"},{\"id\":\"baba8b36-327e-4c5b-8e1c-d5772b3ca259\",\"type\":\"WheelZoomTool\"},{\"id\":\"5ca683ac-d9f5-46e0-96f2-93ab57fdda01\",\"type\":\"BoxZoomTool\"},{\"id\":\"9b97989d-9f25-4b54-8bb3-f8bf643b6583\",\"type\":\"SaveTool\"},{\"id\":\"1f6a7499-87b2-4db0-bfdc-ebdf3dda9513\",\"type\":\"ResetTool\"},{\"id\":\"075afb09-314b-4e78-9164-962cb667735f\",\"type\":\"HelpTool\"}]},\"id\":\"ce30546e-0172-411f-93a9-a222229490d9\",\"type\":\"Toolbar\"},{\"attributes\":{\"callback\":null,\"column_names\":[\"x\",\"y\"],\"data\":{\"x\":{\"__ndarray__\":\"AAAAAAAAAACRGkt8Vz/AP5EaS3xXP9A/2q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nguNNC/B1wUMyam0bw=\",\"dtype\":\"float64\",\"shape\":[100]}}},\"id\":\"bf70061b-efbd-44d2-b9ed-7bc043f7785b\",\"type\":\"ColumnDataSource\"},{\"attributes\":{\"formatter\":{\"id\":\"d66a2351-05cd-4b64-aa24-6c271c7d22f3\",\"type\":\"BasicTickFormatter\"},\"plot\":{\"id\":\"5ebfe401-594a-428b-bfca-356069d2f1df\",\"subtype\":\"Figure\",\"type\":\"Plot\"},\"ticker\":{\"id\":\"e2a95058-38db-479f-ab39-34cb1e6ffbb4\",\"type\":\"BasicTicker\"}},\"id\":\"fd4545b0-2f46-464f-b391-2a3d95c98ec5\",\"type\":\"LinearAxis\"},{\"attributes\":{\"label\":{\"value\":\"2*sin(x)\"},\"renderers\":[{\"id\":\"75795bbf-bd36-44e9-b776-fd66aaa96190\",\"type\":\"GlyphRenderer\"}]},\"id\":\"9996a23e-e2de-4139-88e6-b5af004f15a4\",\"type\":\"LegendItem\"},{\"attributes\":{\"plot\":null,\"text\":\"\"},\"id\":\"09dcee3c-32f3-4901-b715-0f8f172e20c3\",\"type\":\"Title\"},{\"attributes\":{\"formatter\":{\"id\":\"af9c2ae7-4d9c-49ae-99f9-fb7ed1d8afd2\",\"type\":\"BasicTickFormatter\"},\"plot\":{\"id\":\"5ebfe401-594a-428b-bfca-356069d2f1df\",\"subtype\":\"Figure\",\"type\":\"Plot\"},\"ticker\":{\"id\":\"bc4ce936-107d-4650-ac0d-6f9adf9488d5\",\"type\":\"BasicTicker\"}},\"id\":\"d9f6b8da-c311-46bc-8c59-26a1af583b34\",\"type\":\"LinearAxis\"},{\"attributes\":{},\"id\":\"e2a95058-38db-479f-ab39-34cb1e6ffbb4\",\"type\":\"BasicTicker\"}],\"root_ids\":[\"5ebfe401-594a-428b-bfca-356069d2f1df\"]},\"title\":\"Bokeh Application\",\"version\":\"0.12.10\"}};\n",
       "    var render_items = [{\"docid\":\"87f145ba-0d85-428c-849b-c09c5c7b6478\",\"elementid\":\"1738cb4c-dfea-4e8c-afb9-86f99713b3c9\",\"modelid\":\"5ebfe401-594a-428b-bfca-356069d2f1df\"}];\n",
       "\n",
       "    root.Bokeh.embed.embed_items(docs_json, render_items);\n",
       "  }\n",
       "\n",
       "  if (root.Bokeh !== undefined) {\n",
       "    embed_document(root);\n",
       "  } else {\n",
       "    var attempts = 0;\n",
       "    var timer = setInterval(function(root) {\n",
       "      if (root.Bokeh !== undefined) {\n",
       "        embed_document(root);\n",
       "        clearInterval(timer);\n",
       "      }\n",
       "      attempts++;\n",
       "      if (attempts > 100) {\n",
       "        console.log(\"Bokeh: ERROR: Unable to embed document because BokehJS library is missing\")\n",
       "        clearInterval(timer);\n",
       "      }\n",
       "    }, 10, root)\n",
       "  }\n",
       "})(window);"
      ],
      "application/vnd.bokehjs_exec.v0+json": ""
     },
     "metadata": {
      "application/vnd.bokehjs_exec.v0+json": {
       "id": "5ebfe401-594a-428b-bfca-356069d2f1df"
      }
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "import numpy as np\n",
    "\n",
    "x = np.linspace(0, 4*np.pi, 100)\n",
    "y = np.sin(x)\n",
    "\n",
    "p = figure(height=400)\n",
    "\n",
    "p.circle(x, y, legend=\"sin(x)\")\n",
    "p.line(x, 2*y, legend=\"2*sin(x)\", line_dash=[4, 4], line_color=\"orange\", line_width=2)\n",
    "\n",
    "show(p)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Compound legends（复合图例）\n",
    "\n",
    "有时，针对一个数据源会使用两个（或更多）不同的glyph标记符号。在这种情况下，可以通过给多个glyph方法指定同样的图例参数来创建复合图例，如：\n",
    "\n",
    "```python\n",
    "p.circle(x, y, legend=\"sin(x)\")\n",
    "p.line(x, y, legend=\"sin(x)\", line_dash=[4, 4], line_color=\"orange\", line_width=2)\n",
    "```\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "# EXERCISE:  \n",
    "# (1) Try making a compound legend \n",
    "# (2) Try moving the legend using p.legend.location.  Possible values are listed in bokeh.core.enum\n",
    "\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Legend Orientation and Positioning（图例的方向和位置）"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "# Exercise"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Color bars（彩色柱状图）"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "D:\\ProgramData\\Anaconda3\\lib\\site-packages\\bokeh\\core\\json_encoder.py:80: FutureWarning: Conversion of the second argument of issubdtype from `float` to `np.floating` is deprecated. In future, it will be treated as `np.float64 == np.dtype(float).type`.\n",
      "  elif np.issubdtype(type(obj), np.float):\n"
     ]
    },
    {
     "data": {
      "text/html": [
       "\n",
       "<div class=\"bk-root\">\n",
       "    <div class=\"bk-plotdiv\" id=\"70ff7e9c-1531-4e7c-acc0-707e1f877cd4\"></div>\n",
       "</div>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "application/javascript": [
       "(function(root) {\n",
       "  function embed_document(root) {\n",
       "    var docs_json = {\"3c57e0ce-245d-480b-aa8d-75aa7081a2e0\":{\"roots\":{\"references\":[{\"attributes\":{\"below\":[{\"id\":\"709377ac-373f-439f-aa97-12950654aba9\",\"type\":\"LinearAxis\"}],\"left\":[{\"id\":\"29e478ee-ee61-49e4-af7d-e4b3dfde9438\",\"type\":\"LinearAxis\"}],\"renderers\":[{\"id\":\"709377ac-373f-439f-aa97-12950654aba9\",\"type\":\"LinearAxis\"},{\"id\":\"32fe7dc3-1330-4501-a685-6a9ca0a37d90\",\"type\":\"Grid\"},{\"id\":\"29e478ee-ee61-49e4-af7d-e4b3dfde9438\",\"type\":\"LinearAxis\"},{\"id\":\"9ed9c8db-9d26-460f-bb6f-aa275b20bb0b\",\"type\":\"Grid\"},{\"id\":\"f9d03ed5-fa34-4793-a23a-2b60a10bd82f\",\"type\":\"GlyphRenderer\"},{\"id\":\"803dd47b-2cd2-4101-adf7-93f7131d9d3a\",\"type\":\"ColorBar\"}],\"right\":[{\"id\":\"803dd47b-2cd2-4101-adf7-93f7131d9d3a\",\"type\":\"ColorBar\"}],\"title\":{\"id\":\"8289340a-1ef5-4928-a65b-1cc62e514e68\",\"type\":\"Title\"},\"toolbar\":{\"id\":\"16d9a6b6-c2f0-4531-9fe5-6a0fd754a9c8\",\"type\":\"Toolbar\"},\"toolbar_location\":\"above\",\"x_range\":{\"id\":\"14405caf-d39d-49b7-80a9-9e36ca564212\",\"type\":\"DataRange1d\"},\"x_scale\":{\"id\":\"e578d5b1-ce5c-4b66-b1e1-2c1631c41c67\",\"type\":\"LinearScale\"},\"y_range\":{\"id\":\"74f62ad9-0626-4221-82a1-2ceb3f0bbed5\",\"type\":\"DataRange1d\"},\"y_scale\":{\"id\":\"72a8a5fc-e391-44d6-8e17-ec2b45a6a3bb\",\"type\":\"LinearScale\"}},\"id\":\"26e87358-1357-4257-a196-bc68d5a7a235\",\"subtype\":\"Figure\",\"type\":\"Plot\"},{\"attributes\":{\"color_mapper\":{\"id\":\"4008310e-0434-43ac-8c9a-6503f46a62ca\",\"type\":\"LinearColorMapper\"},\"formatter\":{\"id\":\"dab713c7-43b3-407f-8e43-2cfd0b07aea0\",\"type\":\"BasicTickFormatter\"},\"label_standoff\":12,\"location\":[0,0],\"plot\":{\"id\":\"26e87358-1357-4257-a196-bc68d5a7a235\",\"subtype\":\"Figure\",\"type\":\"Plot\"},\"ticker\":{\"id\":\"100571ea-3d00-4ef7-8cf5-44459e1a3e2f\",\"type\":\"BasicTicker\"},\"title\":\"Weight\"},\"id\":\"803dd47b-2cd2-4101-adf7-93f7131d9d3a\",\"type\":\"ColorBar\"},{\"attributes\":{\"source\":{\"id\":\"39e4a019-a278-445b-9ed2-400174a2471e\",\"type\":\"ColumnDataSource\"}},\"id\":\"2cfee806-e41c-4a09-8549-21eb21416431\",\"type\":\"CDSView\"},{\"attributes\":{},\"id\":\"ae95c538-b8df-4447-ae17-8beefa44c30c\",\"type\":\"BasicTicker\"},{\"attributes\":{},\"id\":\"100571ea-3d00-4ef7-8cf5-44459e1a3e2f\",\"type\":\"BasicTicker\"},{\"attributes\":{},\"id\":\"97935014-3a4b-47de-8011-3e3d6cd91b3b\",\"type\":\"BasicTicker\"},{\"attributes\":{\"plot\":null,\"text\":\"\"},\"id\":\"8289340a-1ef5-4928-a65b-1cc62e514e68\",\"type\":\"Title\"},{\"attributes\":{\"axis_label\":\"Year\",\"formatter\":{\"id\":\"4ddc34ec-a22f-46df-b75f-3078000e37d2\",\"type\":\"BasicTickFormatter\"},\"plot\":{\"id\":\"26e87358-1357-4257-a196-bc68d5a7a235\",\"subtype\":\"Figure\",\"type\":\"Plot\"},\"ticker\":{\"id\":\"97935014-3a4b-47de-8011-3e3d6cd91b3b\",\"type\":\"BasicTicker\"}},\"id\":\"709377ac-373f-439f-aa97-12950654aba9\",\"type\":\"LinearAxis\"},{\"attributes\":{\"plot\":{\"id\":\"26e87358-1357-4257-a196-bc68d5a7a235\",\"subtype\":\"Figure\",\"type\":\"Plot\"},\"ticker\":{\"id\":\"97935014-3a4b-47de-8011-3e3d6cd91b3b\",\"type\":\"BasicTicker\"}},\"id\":\"32fe7dc3-1330-4501-a685-6a9ca0a37d90\",\"type\":\"Grid\"},{\"attributes\":{},\"id\":\"dab713c7-43b3-407f-8e43-2cfd0b07aea0\",\"type\":\"BasicTickFormatter\"},{\"attributes\":{\"callback\":null},\"id\":\"14405caf-d39d-49b7-80a9-9e36ca564212\",\"type\":\"DataRange1d\"},{\"attributes\":{\"high\":5140,\"low\":1613,\"palette\":[\"#440154\",\"#440255\",\"#440357\",\"#450558\",\"#45065A\",\"#45085B\",\"#46095C\",\"#460B5E\",\"#460C5F\",\"#460E61\",\"#470F62\",\"#471163\",\"#471265\",\"#471466\",\"#471567\",\"#471669\",\"#47186A\",\"#48196B\",\"#481A6C\",\"#481C6E\",\"#481D6F\",\"#481E70\",\"#482071\",\"#482172\",\"#482273\",\"#482374\",\"#472575\",\"#472676\",\"#472777\",\"#472878\",\"#472A79\",\"#472B7A\",\"#472C7B\",\"#462D7C\",\"#462F7C\",\"#46307D\",\"#46317E\",\"#45327F\",\"#45347F\",\"#453580\",\"#453681\",\"#443781\",\"#443982\",\"#433A83\",\"#433B83\",\"#433C84\",\"#423D84\",\"#423E85\",\"#424085\",\"#414186\",\"#414286\",\"#404387\",\"#404487\",\"#3F4587\",\"#3F4788\",\"#3E4888\",\"#3E4989\",\"#3D4A89\",\"#3D4B89\",\"#3D4C89\",\"#3C4D8A\",\"#3C4E8A\",\"#3B508A\",\"#3B518A\",\"#3A528B\",\"#3A538B\",\"#39548B\",\"#39558B\",\"#38568B\",\"#38578C\",\"#37588C\",\"#37598C\",\"#365A8C\",\"#365B8C\",\"#355C8C\",\"#355D8C\",\"#345E8D\",\"#345F8D\",\"#33608D\",\"#33618D\",\"#32628D\",\"#32638D\",\"#31648D\",\"#31658D\",\"#31668D\",\"#30678D\",\"#30688D\",\"#2F698D\",\"#2F6A8D\",\"#2E6B8E\",\"#2E6C8E\",\"#2E6D8E\",\"#2D6E8E\",\"#2D6F8E\",\"#2C708E\",\"#2C718E\",\"#2C728E\",\"#2B738E\",\"#2B748E\",\"#2A758E\",\"#2A768E\",\"#2A778E\",\"#29788E\",\"#29798E\",\"#287A8E\",\"#287A8E\",\"#287B8E\",\"#277C8E\",\"#277D8E\",\"#277E8E\",\"#267F8E\",\"#26808E\",\"#26818E\",\"#25828E\",\"#25838D\",\"#24848D\",\"#24858D\",\"#24868D\",\"#23878D\",\"#23888D\",\"#23898D\",\"#22898D\",\"#228A8D\",\"#228B8D\",\"#218C8D\",\"#218D8C\",\"#218E8C\",\"#208F8C\",\"#20908C\",\"#20918C\",\"#1F928C\",\"#1F938B\",\"#1F948B\",\"#1F958B\",\"#1F968B\",\"#1E978A\",\"#1E988A\",\"#1E998A\",\"#1E998A\",\"#1E9A89\",\"#1E9B89\",\"#1E9C89\",\"#1E9D88\",\"#1E9E88\",\"#1E9F88\",\"#1EA087\",\"#1FA187\",\"#1FA286\",\"#1FA386\",\"#20A485\",\"#20A585\",\"#21A685\",\"#21A784\",\"#22A784\",\"#23A883\",\"#23A982\",\"#24AA82\",\"#25AB81\",\"#26AC81\",\"#27AD80\",\"#28AE7F\",\"#29AF7F\",\"#2AB07E\",\"#2BB17D\",\"#2CB17D\",\"#2EB27C\",\"#2FB37B\",\"#30B47A\",\"#32B57A\",\"#33B679\",\"#35B778\",\"#36B877\",\"#38B976\",\"#39B976\",\"#3BBA75\",\"#3DBB74\",\"#3EBC73\",\"#40BD72\",\"#42BE71\",\"#44BE70\",\"#45BF6F\",\"#47C06E\",\"#49C16D\",\"#4BC26C\",\"#4DC26B\",\"#4FC369\",\"#51C468\",\"#53C567\",\"#55C666\",\"#57C665\",\"#59C764\",\"#5BC862\",\"#5EC961\",\"#60C960\",\"#62CA5F\",\"#64CB5D\",\"#67CC5C\",\"#69CC5B\",\"#6BCD59\",\"#6DCE58\",\"#70CE56\",\"#72CF55\",\"#74D054\",\"#77D052\",\"#79D151\",\"#7CD24F\",\"#7ED24E\",\"#81D34C\",\"#83D34B\",\"#86D449\",\"#88D547\",\"#8BD546\",\"#8DD644\",\"#90D643\",\"#92D741\",\"#95D73F\",\"#97D83E\",\"#9AD83C\",\"#9DD93A\",\"#9FD938\",\"#A2DA37\",\"#A5DA35\",\"#A7DB33\",\"#AADB32\",\"#ADDC30\",\"#AFDC2E\",\"#B2DD2C\",\"#B5DD2B\",\"#B7DD29\",\"#BADE27\",\"#BDDE26\",\"#BFDF24\",\"#C2DF22\",\"#C5DF21\",\"#C7E01F\",\"#CAE01E\",\"#CDE01D\",\"#CFE11C\",\"#D2E11B\",\"#D4E11A\",\"#D7E219\",\"#DAE218\",\"#DCE218\",\"#DFE318\",\"#E1E318\",\"#E4E318\",\"#E7E419\",\"#E9E419\",\"#ECE41A\",\"#EEE51B\",\"#F1E51C\",\"#F3E51E\",\"#F6E61F\",\"#F8E621\",\"#FAE622\",\"#FDE724\"]},\"id\":\"4008310e-0434-43ac-8c9a-6503f46a62ca\",\"type\":\"LinearColorMapper\"},{\"attributes\":{},\"id\":\"e578d5b1-ce5c-4b66-b1e1-2c1631c41c67\",\"type\":\"LinearScale\"},{\"attributes\":{},\"id\":\"b8fabc2d-8b1a-49d4-b69d-c36113ed6418\",\"type\":\"BasicTickFormatter\"},{\"attributes\":{},\"id\":\"4ddc34ec-a22f-46df-b75f-3078000e37d2\",\"type\":\"BasicTickFormatter\"},{\"attributes\":{\"fill_alpha\":{\"value\":0.6},\"fill_color\":{\"field\":\"weight\",\"transform\":{\"id\":\"4008310e-0434-43ac-8c9a-6503f46a62ca\",\"type\":\"LinearColorMapper\"}},\"line_alpha\":{\"value\":0.6},\"line_color\":{\"field\":\"weight\",\"transform\":{\"id\":\"4008310e-0434-43ac-8c9a-6503f46a62ca\",\"type\":\"LinearColorMapper\"}},\"size\":{\"units\":\"screen\",\"value\":20},\"x\":{\"field\":\"yr\"},\"y\":{\"field\":\"mpg\"}},\"id\":\"ccc22729-6c46-4d45-835b-8a21e3863dab\",\"type\":\"Circle\"},{\"attributes\":{\"data_source\":{\"id\":\"39e4a019-a278-445b-9ed2-400174a2471e\",\"type\":\"ColumnDataSource\"},\"glyph\":{\"id\":\"ccc22729-6c46-4d45-835b-8a21e3863dab\",\"type\":\"Circle\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"2f9b757a-1ef2-4d2c-a9e7-c40a8839688c\",\"type\":\"Circle\"},\"selection_glyph\":null,\"view\":{\"id\":\"2cfee806-e41c-4a09-8549-21eb21416431\",\"type\":\"CDSView\"}},\"id\":\"f9d03ed5-fa34-4793-a23a-2b60a10bd82f\",\"type\":\"GlyphRenderer\"},{\"attributes\":{},\"id\":\"72a8a5fc-e391-44d6-8e17-ec2b45a6a3bb\",\"type\":\"LinearScale\"},{\"attributes\":{\"fill_alpha\":{\"value\":0.1},\"fill_color\":{\"value\":\"#1f77b4\"},\"line_alpha\":{\"value\":0.1},\"line_color\":{\"value\":\"#1f77b4\"},\"size\":{\"units\":\"screen\",\"value\":20},\"x\":{\"field\":\"yr\"},\"y\":{\"field\":\"mpg\"}},\"id\":\"2f9b757a-1ef2-4d2c-a9e7-c40a8839688c\",\"type\":\"Circle\"},{\"attributes\":{\"dimension\":1,\"plot\":{\"id\":\"26e87358-1357-4257-a196-bc68d5a7a235\",\"subtype\":\"Figure\",\"type\":\"Plot\"},\"ticker\":{\"id\":\"ae95c538-b8df-4447-ae17-8beefa44c30c\",\"type\":\"BasicTicker\"}},\"id\":\"9ed9c8db-9d26-460f-bb6f-aa275b20bb0b\",\"type\":\"Grid\"},{\"attributes\":{\"callback\":null,\"column_names\":[\"mpg\",\"cyl\",\"displ\",\"hp\",\"weight\",\"accel\",\"yr\",\"origin\",\"name\",\"index\"],\"data\":{\"accel\":{\"__ndarray__\":\"AAAAAAAAKEAAAAAAAAAnQAAAAAAAACZAAAAAAAAAKEAAAAAAAAAlQAAAAAAAACRAAAAAAAAAIkAAAAAAAAAhQAAAAAAAACRAAAAAAAAAIUAAAAAAAAAkQAAAAAAAACBAAAAAAAAAI0AAAAAAAAAkQAAAAAAAAC5AAAAAAAAAL0AAAAAAAAAvQAAAAAAAADBAAAAAAAAALUAAAAAAAIA0QAAAAAAAgDFAAAAAAAAALUAAAAAAAIAxQAAAAAAAAClAAAAAAAAALkAAAAAAAAAsQAAAAAAAAC5AAAAAAAAAK0AAAAAAAIAyQAAAAAAAAC1AAAAAAAAAL0AAAAAAAAAsQAAAAAAAACpAAAAAAAAAL0AAAAAAAAAvQAAAAAAAAC9AAAAAAAAAL0AAAAAAAAAoQAAAAAAAACdAAAAAAAAAK0AAAAAAAAAqQAAAAAAAACdAAAAAAAAAKEAAAAAAAAAoQA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AAAAAAAABcQAAAAAAAAFxAAAAAAADgYEAAAAAAAOBiQAAAAAAAgGFAAAAAAABAWkAAAAAAAMBWQAAAAAAAwFZAAAAAAABAWkAAAAAAAIBYQAAAAAAAAF5AAAAAAADAWkAAAAAAAABbQAAAAAAAwFZAAAAAAADAVkAAAAAAAMBWQAAAAAAAoGZAAAAAAABgcEAAAAAAAIBjQAAAAAAAAG1AAAAAAAAAYkAAAAAAAOBgQAAAAAAA4GJAAAAAAACAYUAAAAAAAEBYQAAAAAAA4GBAAAAAAAAAXkAAAAAAAMBdQA==\",\"dtype\":\"float64\",\"shape\":[392]},\"hp\":[130,165,150,150,140,198,220,215,225,190,170,160,150,225,95,95,97,85,88,46,87,90,95,113,90,215,200,210,193,88,90,95,100,105,100,88,100,165,175,153,150,180,170,175,110,72,100,88,86,90,70,76,65,69,60,70,95,80,54,90,86,165,175,150,153,150,208,155,160,190,97,150,130,140,150,112,76,87,69,86,92,97,80,88,175,150,145,137,150,198,150,158,150,215,225,175,105,100,100,88,95,46,150,167,170,180,100,88,72,94,90,85,107,90,145,230,49,75,91,112,150,110,122,180,95,100,100,67,80,65,75,100,110,105,140,150,150,140,150,83,67,78,52,61,75,75,75,97,93,67,95,105,72,72,170,145,150,148,110,105,110,95,110,110,129,75,83,100,78,96,71,97,97,70,90,95,88,98,115,53,86,81,92,79,83,140,150,120,152,100,105,81,90,52,60,70,53,100,78,110,95,71,70,75,72,102,150,88,108,120,180,145,130,150,68,80,58,96,70,145,110,145,130,110,105,100,98,180,170,190,149,78,88,75,89,63,83,67,78,97,110,110,48,66,52,70,60,110,140,139,105,95,85,88,100,90,105,85,110,120,145,165,139,140,68,95,97,75,95,105,85,97,103,125,115,133,71,68,115,85,88,90,110,130,129,138,135,155,142,125,150,71,65,80,80,77,125,71,90,70,70,65,69,90,115,115,90,76,60,70,65,90,88,90,90,78,90,75,92,75,65,105,65,48,48,67,67,67,67,62,132,100,88,72,84,84,92,110,84,58,64,60,67,65,62,68,63,65,65,74,75,75,100,74,80,76,116,120,110,105,88,85,88,88,88,85,84,90,92,74,68,68,63,70,88,75,70,67,67,67,110,85,92,112,96,84,90,86,52,84,79,82],\"index\":[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,256,257,258,259,260,261,262,263,264,265,266,267,268,269,270,271,272,273,274,275,276,277,278,279,280,281,282,283,284,285,286,287,288,289,290,291,292,293,294,295,296,297,298,299,300,301,302,303,304,305,306,307,308,309,310,311,312,313,314,315,316,317,318,319,320,321,322,323,324,325,326,327,328,329,330,331,332,333,334,335,336,337,338,339,340,341,342,343,344,345,346,347,348,349,350,351,352,353,354,355,356,357,358,359,360,361,362,363,364,365,366,367,368,369,370,371,372,373,374,375,376,377,378,379,380,381,382,383,384,385,386,387,388,389,390,391],\"mpg\":{\"__ndarray__\":\"AAAAAAAAMkAAAAAAAAAuQAAAAAAAADJAAAAAAAAAMEAAAAAAAAAxQAAAAAAAAC5AAAAAAAAALEAAAAAAAAAsQAAAAAAAACxAAAAAAAAALkAAAAAAAAAuQAAAAAAAACxAAAAAAAA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ZmZlCQAAAAAAAADxAZmZmZmZmOkDNzMzMzEw4QJqZmZmZGTNAZmZmZmYmQUDNzMzMzMw9QM3MzMzMTD9AAAAAAACAQkCamZmZmRlAQM3MzMzMTEdAZmZmZmbmO0BmZmZmZmZEQGZmZmZmJkZAMzMzMzOzRUAzMzMzMzNCQAAAAAAAAD5AzczMzMxMRkBmZmZmZuZAQM3MzMzMzD1AmpmZmZlZQEAzMzMzM7M3QAAAAAAAgEFAMzMzMzMzQEAzMzMzMzM7QJqZmZmZmTpAzczMzMzMOUAAAAAAAIA3QAAAAAAAAD5AzczMzMyMQ0AAAAAAAIBDQM3MzMzMjEFAZmZmZmYmQEAAAAAAAIBCQJqZmZmZ2UJAzczMzMwMQUCamZmZmVlBQDMzMzMzM0FAZmZmZmbmPUAAAAAAAIBAQJqZmZmZ2UBAMzMzMzMzQEAzMzMzM3NAQJqZmZmZmT9AmpmZmZkZPEAzMzMzM7M+QGZmZmZmZjlAMzMzMzMzOEBmZmZmZmY2QJqZmZmZmTpAMzMzMzMzNECamZmZmZkxQAAAAAAAADxAAAAAAAAAO0AAAAAAAABBQAAAAAAAAD9AAAAAAAAAPUAAAAAAAAA7QAAAAAAAADhAAAAAAAAAQkAAAAAAAIBCQAAAAAAAAD9AAAAAAAAAQ0AAAAAAAABCQAAAAAAAAEJAAAAAAAAAQkAAAAAAAABBQAAAAAAAAENAAAAAAAAAQEAAAAAAAABDQAAAAAAAADlAAAAAAAAAQ0AAAAAAAAA6QAAAAAAAADZAAAAAAAAAQEAAAAAAAABCQAAAAAAAADtAAAAAAAAAO0AAAAAAAABGQAAAAAAAAEBAAAAAAAAAPEAAAAAAAAA/QA==\",\"dtype\":\"float64\",\"shape\":[392]},\"name\":[\"chevrolet chevelle malibu\",\"buick skylark 320\",\"plymouth satellite\",\"amc rebel sst\",\"ford torino\",\"ford galaxie 500\",\"chevrolet impala\",\"plymouth fury iii\",\"pontiac catalina\",\"amc ambassador dpl\",\"dodge challenger se\",\"plymouth 'cuda 340\",\"chevrolet monte carlo\",\"buick estate wagon (sw)\",\"toyota corona mark ii\",\"plymouth duster\",\"amc hornet\",\"ford maverick\",\"datsun pl510\",\"volkswagen 1131 deluxe sedan\",\"peugeot 504\",\"audi 100 ls\",\"saab 99e\",\"bmw 2002\",\"amc gremlin\",\"ford f250\",\"chevy c20\",\"dodge d200\",\"hi 1200d\",\"datsun pl510\",\"chevrolet vega 2300\",\"toyota corona\",\"amc gremlin\",\"plymouth satellite custom\",\"chevrolet chevelle malibu\",\"ford torino 500\",\"amc matador\",\"chevrolet impala\",\"pontiac catalina brougham\",\"ford galaxie 500\",\"plymouth fury iii\",\"dodge monaco (sw)\",\"ford country squire (sw)\",\"pontiac safari (sw)\",\"amc hornet sportabout (sw)\",\"chevrolet vega (sw)\",\"pontiac firebird\",\"ford mustang\",\"mercury capri 2000\",\"opel 1900\",\"peugeot 304\",\"fiat 124b\",\"toyota corolla 1200\",\"datsun 1200\",\"volkswagen model 111\",\"plymouth cricket\",\"toyota corona hardtop\",\"dodge colt hardtop\",\"volkswagen type 3\",\"chevrolet vega\",\"ford pinto runabout\",\"chevrolet impala\",\"pontiac catalina\",\"plymouth fury iii\",\"ford galaxie 500\",\"amc ambassador sst\",\"mercury marquis\",\"buick lesabre custom\",\"oldsmobile delta 88 royale\",\"chrysler newport royal\",\"mazda rx2 coupe\",\"amc matador (sw)\",\"chevrolet chevelle concours (sw)\",\"ford gran torino (sw)\",\"plymouth satellite custom (sw)\",\"volvo 145e (sw)\",\"volkswagen 411 (sw)\",\"peugeot 504 (sw)\",\"renault 12 (sw)\",\"ford pinto (sw)\",\"datsun 510 (sw)\",\"toyouta corona mark ii (sw)\",\"dodge colt (sw)\",\"toyota corolla 1600 (sw)\",\"buick century 350\",\"amc matador\",\"chevrolet malibu\",\"ford gran torino\",\"dodge coronet custom\",\"mercury marquis brougham\",\"chevrolet caprice classic\",\"ford ltd\",\"plymouth fury gran sedan\",\"chrysler new yorker brougham\",\"buick electra 225 custom\",\"amc ambassador brougham\",\"plymouth valiant\",\"chevrolet nova custom\",\"amc hornet\",\"ford maverick\",\"plymouth duster\",\"volkswagen super beetle\",\"chevrolet impala\",\"ford country\",\"plymouth custom suburb\",\"oldsmobile vista cruiser\",\"amc gremlin\",\"toyota carina\",\"chevrolet vega\",\"datsun 610\",\"maxda rx3\",\"ford pinto\",\"mercury capri v6\",\"fiat 124 sport coupe\",\"chevrolet monte carlo s\",\"pontiac grand prix\",\"fiat 128\",\"opel manta\",\"audi 100ls\",\"volvo 144ea\",\"dodge dart custom\",\"saab 99le\",\"toyota mark ii\",\"oldsmobile omega\",\"plymouth duster\",\"amc hornet\",\"chevrolet nova\",\"datsun b210\",\"ford pinto\",\"toyota corolla 1200\",\"chevrolet vega\",\"chevrolet chevelle malibu classic\",\"amc matador\",\"plymouth satellite sebring\",\"ford gran torino\",\"buick century luxus (sw)\",\"dodge coronet custom (sw)\",\"ford gran torino (sw)\",\"amc matador (sw)\",\"audi fox\",\"volkswagen dasher\",\"opel manta\",\"toyota corona\",\"datsun 710\",\"dodge colt\",\"fiat 128\",\"fiat 124 tc\",\"honda civic\",\"subaru\",\"fiat x1.9\",\"plymouth valiant custom\",\"chevrolet nova\",\"mercury monarch\",\"ford maverick\",\"pontiac catalina\",\"chevrolet bel air\",\"plymouth grand fury\",\"ford ltd\",\"buick century\",\"chevroelt chevelle malibu\",\"amc matador\",\"plymouth fury\",\"buick skyhawk\",\"chevrolet monza 2+2\",\"ford mustang ii\",\"toyota corolla\",\"ford pinto\",\"amc gremlin\",\"pontiac astro\",\"toyota corona\",\"volkswagen dasher\",\"datsun 710\",\"ford pinto\",\"volkswagen rabbit\",\"amc pacer\",\"audi 100ls\",\"peugeot 504\",\"volvo 244dl\",\"saab 99le\",\"honda civic cvcc\",\"fiat 131\",\"opel 1900\",\"capri ii\",\"dodge colt\",\"renault 12tl\",\"chevrolet chevelle malibu classic\",\"dodge coronet brougham\",\"amc matador\",\"ford gran torino\",\"plymouth valiant\",\"chevrolet nova\",\"ford maverick\",\"amc hornet\",\"chevrolet chevette\",\"chevrolet woody\",\"vw rabbit\",\"honda civic\",\"dodge aspen se\",\"ford granada ghia\",\"pontiac ventura sj\",\"amc pacer d/l\",\"volkswagen rabbit\",\"datsun b-210\",\"toyota corolla\",\"ford pinto\",\"volvo 245\",\"plymouth volare premier v8\",\"peugeot 504\",\"toyota mark ii\",\"mercedes-benz 280s\",\"cadillac seville\",\"chevy c10\",\"ford f108\",\"dodge d100\",\"honda accord cvcc\",\"buick opel isuzu deluxe\",\"renault 5 gtl\",\"plymouth arrow gs\",\"datsun f-10 hatchback\",\"chevrolet caprice classic\",\"oldsmobile cutlass supreme\",\"dodge monaco brougham\",\"mercury cougar brougham\",\"chevrolet concours\",\"buick skylark\",\"plymouth volare custom\",\"ford granada\",\"pontiac grand prix lj\",\"chevrolet monte carlo landau\",\"chrysler cordoba\",\"ford thunderbird\",\"volkswagen rabbit custom\",\"pontiac sunbird coupe\",\"toyota corolla liftback\",\"ford mustang ii 2+2\",\"chevrolet chevette\",\"dodge colt m/m\",\"subaru dl\",\"volkswagen dasher\",\"datsun 810\",\"bmw 320i\",\"mazda rx-4\",\"volkswagen rabbit custom diesel\",\"ford fiesta\",\"mazda glc deluxe\",\"datsun b210 gx\",\"honda civic cvcc\",\"oldsmobile cutlass salon brougham\",\"dodge diplomat\",\"mercury monarch ghia\",\"pontiac phoenix lj\",\"chevrolet malibu\",\"ford fairmont (auto)\",\"ford fairmont (man)\",\"plymouth volare\",\"amc concord\",\"buick century special\",\"mercury zephyr\",\"dodge aspen\",\"amc concord d/l\",\"chevrolet monte carlo landau\",\"buick regal sport coupe (turbo)\",\"ford futura\",\"dodge magnum xe\",\"chevrolet chevette\",\"toyota corona\",\"datsun 510\",\"dodge omni\",\"toyota celica gt liftback\",\"plymouth sapporo\",\"oldsmobile starfire sx\",\"datsun 200-sx\",\"audi 5000\",\"volvo 264gl\",\"saab 99gle\",\"peugeot 604sl\",\"volkswagen scirocco\",\"honda accord lx\",\"pontiac lemans v6\",\"mercury zephyr 6\",\"ford fairmont 4\",\"amc concord dl 6\",\"dodge aspen 6\",\"chevrolet caprice classic\",\"ford ltd landau\",\"mercury grand marquis\",\"dodge st. regis\",\"buick estate wagon (sw)\",\"ford country squire (sw)\",\"chevrolet malibu classic (sw)\",\"chrysler lebaron town @ country (sw)\",\"vw rabbit custom\",\"maxda glc deluxe\",\"dodge colt hatchback custom\",\"amc spirit dl\",\"mercedes benz 300d\",\"cadillac eldorado\",\"peugeot 504\",\"oldsmobile cutlass salon brougham\",\"plymouth horizon\",\"plymouth horizon tc3\",\"datsun 210\",\"fiat strada custom\",\"buick skylark limited\",\"chevrolet citation\",\"oldsmobile omega brougham\",\"pontiac phoenix\",\"vw rabbit\",\"toyota corolla tercel\",\"chevrolet chevette\",\"datsun 310\",\"chevrolet citation\",\"ford fairmont\",\"amc concord\",\"dodge aspen\",\"audi 4000\",\"toyota corona liftback\",\"mazda 626\",\"datsun 510 hatchback\",\"toyota corolla\",\"mazda glc\",\"dodge colt\",\"datsun 210\",\"vw rabbit c (diesel)\",\"vw dasher (diesel)\",\"audi 5000s (diesel)\",\"mercedes-benz 240d\",\"honda civic 1500 gl\",\"subaru dl\",\"vokswagen rabbit\",\"datsun 280-zx\",\"mazda rx-7 gs\",\"triumph tr7 coupe\",\"honda accord\",\"plymouth reliant\",\"buick skylark\",\"dodge aries wagon (sw)\",\"chevrolet citation\",\"plymouth reliant\",\"toyota starlet\",\"plymouth champ\",\"honda civic 1300\",\"subaru\",\"datsun 210 mpg\",\"toyota tercel\",\"mazda glc 4\",\"plymouth horizon 4\",\"ford escort 4w\",\"ford escort 2h\",\"volkswagen jetta\",\"honda prelude\",\"toyota corolla\",\"datsun 200sx\",\"mazda 626\",\"peugeot 505s turbo diesel\",\"volvo diesel\",\"toyota cressida\",\"datsun 810 maxima\",\"buick century\",\"oldsmobile cutlass ls\",\"ford granada gl\",\"chrysler lebaron salon\",\"chevrolet cavalier\",\"chevrolet cavalier wagon\",\"chevrolet cavalier 2-door\",\"pontiac j2000 se hatchback\",\"dodge aries se\",\"pontiac phoenix\",\"ford fairmont futura\",\"volkswagen rabbit l\",\"mazda glc custom l\",\"mazda glc custom\",\"plymouth horizon miser\",\"mercury lynx l\",\"nissan stanza xe\",\"honda accord\",\"toyota corolla\",\"honda civic\",\"honda civic (auto)\",\"datsun 310 gx\",\"buick century limited\",\"oldsmobile cutlass ciera (diesel)\",\"chrysler lebaron medallion\",\"ford granada l\",\"toyota celica gt\",\"dodge charger 2.2\",\"chevrolet camaro\",\"ford mustang gl\",\"vw pickup\",\"dodge rampage\",\"ford ranger\",\"chevy s-10\"],\"origin\":[1,1,1,1,1,1,1,1,1,1,1,1,1,1,3,1,1,1,3,2,2,2,2,2,1,1,1,1,1,3,1,3,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,2,2,3,3,2,1,3,1,2,1,1,1,1,1,1,1,1,1,1,1,3,1,1,1,1,2,2,2,2,1,3,3,1,3,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,1,1,1,1,1,3,1,3,3,1,1,2,1,1,2,2,2,2,1,2,3,1,1,1,1,3,1,3,1,1,1,1,1,1,1,1,1,2,2,2,3,3,1,2,2,3,3,2,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,3,1,1,1,3,2,3,1,2,1,2,2,2,2,3,2,2,1,1,2,1,1,1,1,1,1,1,1,1,1,2,3,1,1,1,1,2,3,3,1,2,1,2,3,2,1,1,1,1,3,1,2,1,3,1,1,1,1,1,1,1,1,1,1,1,1,2,1,3,1,1,1,3,2,3,2,3,2,1,3,3,3,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,3,3,1,3,1,1,3,2,2,2,2,2,3,1,1,1,1,1,1,1,1,1,1,1,1,1,2,3,1,1,2,1,2,1,1,1,3,2,1,1,1,1,2,3,1,3,1,1,1,1,2,3,3,3,3,3,1,3,2,2,2,2,3,3,2,3,3,2,3,1,1,1,1,1,3,1,3,3,3,3,3,1,1,1,2,3,3,3,3,2,2,3,3,1,1,1,1,1,1,1,1,1,1,1,2,3,3,1,1,3,3,3,3,3,3,1,1,1,1,3,1,1,1,2,1,1,1],\"weight\":[3504,3693,3436,3433,3449,4341,4354,4312,4425,3850,3563,3609,3761,3086,2372,2833,2774,2587,2130,1835,2672,2430,2375,2234,2648,4615,4376,4382,4732,2130,2264,2228,2634,3439,3329,3302,3288,4209,4464,4154,4096,4955,4746,5140,2962,2408,3282,3139,2220,2123,2074,2065,1773,1613,1834,1955,2278,2126,2254,2408,2226,4274,4385,4135,4129,3672,4633,4502,4456,4422,2330,3892,4098,4294,4077,2933,2511,2979,2189,2395,2288,2506,2164,2100,4100,3672,3988,4042,3777,4952,4464,4363,4237,4735,4951,3821,3121,3278,2945,3021,2904,1950,4997,4906,4654,4499,2789,2279,2401,2379,2124,2310,2472,2265,4082,4278,1867,2158,2582,2868,3399,2660,2807,3664,3102,2901,3336,1950,2451,1836,2542,3781,3632,3613,4141,4699,4457,4638,4257,2219,1963,2300,1649,2003,2125,2108,2246,2489,2391,2000,3264,3459,3432,3158,4668,4440,4498,4657,3907,3897,3730,3785,3039,3221,3169,2171,2639,2914,2592,2702,2223,2545,2984,1937,3211,2694,2957,2945,2671,1795,2464,2220,2572,2255,2202,4215,4190,3962,4215,3233,3353,3012,3085,2035,2164,1937,1795,3651,3574,3645,3193,1825,1990,2155,2565,3150,3940,3270,2930,3820,4380,4055,3870,3755,2045,2155,1825,2300,1945,3880,4060,4140,4295,3520,3425,3630,3525,4220,4165,4325,4335,1940,2740,2265,2755,2051,2075,1985,2190,2815,2600,2720,1985,1800,1985,2070,1800,3365,3735,3570,3535,3155,2965,2720,3430,3210,3380,3070,3620,3410,3425,3445,3205,4080,2155,2560,2300,2230,2515,2745,2855,2405,2830,3140,2795,3410,1990,2135,3245,2990,2890,3265,3360,3840,3725,3955,3830,4360,4054,3605,3940,1925,1975,1915,2670,3530,3900,3190,3420,2200,2150,2020,2130,2670,2595,2700,2556,2144,1968,2120,2019,2678,2870,3003,3381,2188,2711,2542,2434,2265,2110,2800,2110,2085,2335,2950,3250,1850,2145,1845,2910,2420,2500,2290,2490,2635,2620,2725,2385,1755,1875,1760,2065,1975,2050,1985,2215,2045,2380,2190,2210,2350,2615,2635,3230,3160,2900,2930,3415,3725,3060,3465,2605,2640,2395,2575,2525,2735,2865,1980,2025,1970,2125,2125,2160,2205,2245,1965,1965,1995,2945,3015,2585,2835,2665,2370,2950,2790,2130,2295,2625,2720],\"yr\":[70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,72,72,72,72,72,72,72,72,72,72,72,72,72,72,72,72,72,72,72,72,72,72,72,72,72,72,72,72,73,73,73,73,73,73,73,73,73,73,73,73,73,73,73,73,73,73,73,73,73,73,73,73,73,73,73,73,73,73,73,73,73,73,73,73,73,73,73,73,74,74,74,74,74,74,74,74,74,74,74,74,74,74,74,74,74,74,74,74,74,74,74,74,74,74,75,75,75,75,75,75,75,75,75,75,75,75,75,75,75,75,75,75,75,75,75,75,75,75,75,75,75,75,75,75,76,76,76,76,76,76,76,76,76,76,76,76,76,76,76,76,76,76,76,76,76,76,76,76,76,76,76,76,76,76,76,76,76,76,77,77,77,77,77,77,77,77,77,77,77,77,77,77,77,77,77,77,77,77,77,77,77,77,77,77,77,77,78,78,78,78,78,78,78,78,78,78,78,78,78,78,78,78,78,78,78,78,78,78,78,78,78,78,78,78,78,78,78,78,78,78,78,78,79,79,79,79,79,79,79,79,79,79,79,79,79,79,79,79,79,79,79,79,79,79,79,79,79,79,79,79,79,80,80,80,80,80,80,80,80,80,80,80,80,80,80,80,80,80,80,80,80,80,80,80,80,80,80,80,81,81,81,81,81,81,81,81,81,81,81,81,81,81,81,81,81,81,81,81,81,81,81,81,81,81,81,81,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82]}},\"id\":\"39e4a019-a278-445b-9ed2-400174a2471e\",\"type\":\"ColumnDataSource\"},{\"attributes\":{\"axis_label\":\"MPG\",\"formatter\":{\"id\":\"b8fabc2d-8b1a-49d4-b69d-c36113ed6418\",\"type\":\"BasicTickFormatter\"},\"plot\":{\"id\":\"26e87358-1357-4257-a196-bc68d5a7a235\",\"subtype\":\"Figure\",\"type\":\"Plot\"},\"ticker\":{\"id\":\"ae95c538-b8df-4447-ae17-8beefa44c30c\",\"type\":\"BasicTicker\"}},\"id\":\"29e478ee-ee61-49e4-af7d-e4b3dfde9438\",\"type\":\"LinearAxis\"},{\"attributes\":{\"callback\":null},\"id\":\"74f62ad9-0626-4221-82a1-2ceb3f0bbed5\",\"type\":\"DataRange1d\"},{\"attributes\":{\"active_drag\":\"auto\",\"active_inspect\":\"auto\",\"active_scroll\":\"auto\",\"active_tap\":\"auto\"},\"id\":\"16d9a6b6-c2f0-4531-9fe5-6a0fd754a9c8\",\"type\":\"Toolbar\"}],\"root_ids\":[\"26e87358-1357-4257-a196-bc68d5a7a235\"]},\"title\":\"Bokeh Application\",\"version\":\"0.12.10\"}};\n",
       "    var render_items = [{\"docid\":\"3c57e0ce-245d-480b-aa8d-75aa7081a2e0\",\"elementid\":\"70ff7e9c-1531-4e7c-acc0-707e1f877cd4\",\"modelid\":\"26e87358-1357-4257-a196-bc68d5a7a235\"}];\n",
       "\n",
       "    root.Bokeh.embed.embed_items(docs_json, render_items);\n",
       "  }\n",
       "\n",
       "  if (root.Bokeh !== undefined) {\n",
       "    embed_document(root);\n",
       "  } else {\n",
       "    var attempts = 0;\n",
       "    var timer = setInterval(function(root) {\n",
       "      if (root.Bokeh !== undefined) {\n",
       "        embed_document(root);\n",
       "        clearInterval(timer);\n",
       "      }\n",
       "      attempts++;\n",
       "      if (attempts > 100) {\n",
       "        console.log(\"Bokeh: ERROR: Unable to embed document because BokehJS library is missing\")\n",
       "        clearInterval(timer);\n",
       "      }\n",
       "    }, 10, root)\n",
       "  }\n",
       "})(window);"
      ],
      "application/vnd.bokehjs_exec.v0+json": ""
     },
     "metadata": {
      "application/vnd.bokehjs_exec.v0+json": {
       "id": "26e87358-1357-4257-a196-bc68d5a7a235"
      }
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "from bokeh.sampledata.autompg import autompg\n",
    "from bokeh.models import LinearColorMapper, ColorBar\n",
    "from bokeh.palettes import Viridis256\n",
    "\n",
    "source = ColumnDataSource(autompg)\n",
    "color_mapper = LinearColorMapper(palette=Viridis256, low=autompg.weight.min(), high=autompg.weight.max())\n",
    "\n",
    "p = figure(x_axis_label='Year', y_axis_label='MPG', tools='', toolbar_location='above')\n",
    "p.circle(x='yr', y='mpg', color={'field': 'weight', 'transform': color_mapper}, size=20, alpha=0.6, source=source)\n",
    "\n",
    "color_bar = ColorBar(color_mapper=color_mapper, label_standoff=12, location=(0,0), title='Weight')\n",
    "p.add_layout(color_bar, 'right')\n",
    "\n",
    "show(p)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "anaconda-cloud": {},
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.6.4"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 1
}
